From nobody Tue Apr 16 13:11:56 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+54106+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+54106+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1581306822004630.4375258374785; Sun, 9 Feb 2020 19:53:42 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id qpfpYY1788612xMJJa1L419Z; Sun, 09 Feb 2020 19:53:41 -0800 X-Received: from mga01.intel.com (mga01.intel.com []) by mx.groups.io with SMTP id smtpd.web10.16855.1581306819865977960 for ; Sun, 09 Feb 2020 19:53:40 -0800 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Feb 2020 19:53:40 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,423,1574150400"; d="scan'208";a="232981256" X-Received: from unknown (HELO cchiu4-MOBL1.gar.corp.intel.com) ([10.5.215.139]) by orsmga003.jf.intel.com with ESMTP; 09 Feb 2020 19:53:39 -0800 From: "Chiu, Chasel" To: devel@edk2.groups.io Cc: Maurice Ma , Nate DeSimone , Star Zeng Subject: [edk2-devel] [PATCH 1/2] IntelFsp2Pkg/GenCfgOpt.py: Coverity scan flags issues. Date: Mon, 10 Feb 2020 11:53:28 +0800 Message-Id: <20200210035329.19432-2-chasel.chiu@intel.com> In-Reply-To: <20200210035329.19432-1-chasel.chiu@intel.com> References: <20200210035329.19432-1-chasel.chiu@intel.com> Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,chasel.chiu@intel.com X-Gm-Message-State: 3BVEmzz9MdxCnNky98MrOcbgx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1581306821; bh=/yVUb8sIKrZDqlHTAq0hagzJ8yQGxk0lAe8MUB/6t/o=; h=Cc:Date:From:Reply-To:Subject:To; b=kslvZPUZfezRywyyoU0hAIZLuKFqseOlT9KtKRcvhP5q6hPTRGDWTNtfzWoxNN8wMpp 0Y+OIZvGduZUMJtqSCUCIlTWHFG3M6QZ7KWwK3J634Bw0DnPuoNOlRm08gt7ZnM7+MQry Vpz+QqvX4IJWcuONuZ0+bvnsv7dWhKZTRYw= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D1706 Issue was: invalid_operation: Invalid operation on null-like value "Base". Fixed it by initializing Base to 0 before entering while loop. Test: Compared script output before and after this patch and the result is identical. Cc: Maurice Ma Cc: Nate DeSimone Cc: Star Zeng Signed-off-by: Chasel Chiu Reviewed-by: Nate DeSimone Reviewed-by: Star Zeng --- IntelFsp2Pkg/Tools/GenCfgOpt.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/IntelFsp2Pkg/Tools/GenCfgOpt.py b/IntelFsp2Pkg/Tools/GenCfgOpt= .py index 2fa7582d85..d1d6901bc3 100644 --- a/IntelFsp2Pkg/Tools/GenCfgOpt.py +++ b/IntelFsp2Pkg/Tools/GenCfgOpt.py @@ -1,6 +1,6 @@ ## @ GenCfgOpt.py # -# Copyright (c) 2014 - 2019, Intel Corporation. All rights reserved.
+# Copyright (c) 2014 - 2020, Intel Corporation. All rights reserved.
# SPDX-License-Identifier: BSD-2-Clause-Patent # ## @@ -439,6 +439,7 @@ EndList =20 MaxAlign =3D 32 #Default align to 32, but if there are 64 bit un= it, align to 64 SizeAlign =3D 0 #record the struct max align + Base =3D 0 #Starting offset of sub-structure. while len(DscLines): DscLine =3D DscLines.pop(0).strip() Handle =3D False --=20 2.13.3.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#54106): https://edk2.groups.io/g/devel/message/54106 Mute This Topic: https://groups.io/mt/71127615/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Tue Apr 16 13:11:56 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+54107+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+54107+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1581306823060912.5885080322007; Sun, 9 Feb 2020 19:53:43 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id C0mLYY1788612xauewXzPWX3; Sun, 09 Feb 2020 19:53:42 -0800 X-Received: from mga01.intel.com (mga01.intel.com []) by mx.groups.io with SMTP id smtpd.web10.16855.1581306819865977960 for ; Sun, 09 Feb 2020 19:53:41 -0800 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Feb 2020 19:53:41 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,423,1574150400"; d="scan'208";a="232981263" X-Received: from unknown (HELO cchiu4-MOBL1.gar.corp.intel.com) ([10.5.215.139]) by orsmga003.jf.intel.com with ESMTP; 09 Feb 2020 19:53:40 -0800 From: "Chiu, Chasel" To: devel@edk2.groups.io Cc: Maurice Ma , Nate DeSimone , Star Zeng Subject: [edk2-devel] [PATCH 2/2] IntelFsp2Pkg/SplitFspBin.py: Coverity scan flags issues. Date: Mon, 10 Feb 2020 11:53:29 +0800 Message-Id: <20200210035329.19432-3-chasel.chiu@intel.com> In-Reply-To: <20200210035329.19432-1-chasel.chiu@intel.com> References: <20200210035329.19432-1-chasel.chiu@intel.com> Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,chasel.chiu@intel.com X-Gm-Message-State: vFiXl7ULlzdbKXPLURS0DWPtx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1581306822; bh=NJy3KmZFvEgvA/TqYmncL+Zre7K16QxBKdM9q6nSDBY=; h=Cc:Date:From:Reply-To:Subject:To; b=DvWsFxoVXIya1DaMfvBMi4t1ponOO3ekbJknBFfD3K+aVtM0CuiNr5vUpDFbuVGsfZp zETEsBU1WW4XCyXdnydBTeTTWJzPDnIiSTC553Kiz1fwqH1I1e0/68ajYTA++4d0Lql8i oHrTV9HvfKZKUcQ6rHEip2AzUS2pVZXIk+s= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D1706 Issues were: 1. copy_paste_error: PeOptHdr vs PePlusOptHdr. 2. invalid_operation: Invalid operation on null-like value "roffset". 3. invalid_operation: Invalid operation on null-like value "rsize". Fixed them by initializing roffset and rsize as PE32 image type and overriding them when PE32+ header found. Test: Compared script output before and after this patch and the result is identical. Cc: Maurice Ma Cc: Nate DeSimone Cc: Star Zeng Signed-off-by: Chasel Chiu Reviewed-by: Nate DeSimone Reviewed-by: Star Zeng --- IntelFsp2Pkg/Tools/SplitFspBin.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/IntelFsp2Pkg/Tools/SplitFspBin.py b/IntelFsp2Pkg/Tools/SplitFs= pBin.py index 39a7ea7460..3c0d5af1b6 100644 --- a/IntelFsp2Pkg/Tools/SplitFspBin.py +++ b/IntelFsp2Pkg/Tools/SplitFspBin.py @@ -1,6 +1,6 @@ ## @ FspTool.py # -# Copyright (c) 2015 - 2019, Intel Corporation. All rights reserved.
+# Copyright (c) 2015 - 2020, Intel Corporation. All rights reserved.
# SPDX-License-Identifier: BSD-2-Clause-Patent # ## @@ -619,10 +619,10 @@ class PeTeImage: rsize =3D self.TeHdr.DataDirectoryBaseReloc.Size roffset =3D sizeof(self.TeHdr) - self.TeHdr.StrippedSize + sel= f.TeHdr.DataDirectoryBaseReloc.VirtualAddress else: - if self.PeHdr.OptionalHeader.PeOptHdr.Magic =3D=3D 0x10b: # PE= 32 image - rsize =3D self.PeHdr.OptionalHeader.PeOptHdr.DataDirecto= ry[EFI_IMAGE_DIRECTORY_ENTRY.BASERELOC].Size - roffset =3D self.PeHdr.OptionalHeader.PeOptHdr.DataDirecto= ry[EFI_IMAGE_DIRECTORY_ENTRY.BASERELOC].VirtualAddress - if self.PeHdr.OptionalHeader.PeOptHdr.Magic =3D=3D 0x20b: # PE= 32+ image + # Assuming PE32 image type (self.PeHdr.OptionalHeader.PeOptHdr= .Magic =3D=3D 0x10b) + rsize =3D self.PeHdr.OptionalHeader.PeOptHdr.DataDirectory[E= FI_IMAGE_DIRECTORY_ENTRY.BASERELOC].Size + roffset =3D self.PeHdr.OptionalHeader.PeOptHdr.DataDirectory[E= FI_IMAGE_DIRECTORY_ENTRY.BASERELOC].VirtualAddress + if self.PeHdr.OptionalHeader.PePlusOptHdr.Magic =3D=3D 0x20b: = # PE32+ image rsize =3D self.PeHdr.OptionalHeader.PePlusOptHdr.DataDir= ectory[EFI_IMAGE_DIRECTORY_ENTRY.BASERELOC].Size roffset =3D self.PeHdr.OptionalHeader.PePlusOptHdr.DataDir= ectory[EFI_IMAGE_DIRECTORY_ENTRY.BASERELOC].VirtualAddress =20 --=20 2.13.3.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#54107): https://edk2.groups.io/g/devel/message/54107 Mute This Topic: https://groups.io/mt/71127616/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-