From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id A571A81EA8 for ; Wed, 16 Nov 2016 00:37:35 -0800 (PST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP; 16 Nov 2016 00:37:40 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,647,1473145200"; d="scan'208";a="1085920645" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by fmsmga002.fm.intel.com with ESMTP; 16 Nov 2016 00:37:39 -0800 Received: from fmsmsx114.amr.corp.intel.com (10.18.116.8) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.248.2; Wed, 16 Nov 2016 00:37:39 -0800 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by FMSMSX114.amr.corp.intel.com (10.18.116.8) with Microsoft SMTP Server (TLS) id 14.3.248.2; Wed, 16 Nov 2016 00:37:38 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.239]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.138]) with mapi id 14.03.0248.002; Wed, 16 Nov 2016 16:37:36 +0800 From: "Yao, Jiewen" To: "Wu, Hao A" , "edk2-devel@lists.01.org" Thread-Topic: [PATCH] SignedCapsulePkg IniParsingLib: ASSERT to ensure 'Value' is not NULL Thread-Index: AQHSP+MsqDNNqkDtLESiNvhJCOZ6kqDbSYsA Date: Wed, 16 Nov 2016 08:37:35 +0000 Message-ID: <74D8A39837DF1E4DA445A8C0B3885C50386D22A2@shsmsx102.ccr.corp.intel.com> References: <1479284761-15060-1-git-send-email-hao.a.wu@intel.com> In-Reply-To: <1479284761-15060-1-git-send-email-hao.a.wu@intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH] SignedCapsulePkg IniParsingLib: ASSERT to ensure 'Value' is not NULL X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Nov 2016 08:37:35 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Jiewen.yao@intel.com > -----Original Message----- > From: Wu, Hao A > Sent: Wednesday, November 16, 2016 4:26 PM > To: edk2-devel@lists.01.org > Cc: Wu, Hao A ; Yao, Jiewen > Subject: [PATCH] SignedCapsulePkg IniParsingLib: ASSERT to ensure 'Value'= is > not NULL >=20 > Function GetStringFromDataFile() ensures its fourth (output) parameter > will not be NULL when the return status is EFI_SUCCESS. >=20 > This commit adds ASSERT as warnings for the case that will not happen. >=20 > Cc: Jiewen Yao > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Hao Wu > --- > SignedCapsulePkg/Library/IniParsingLib/IniParsingLib.c | 4 ++++ > 1 file changed, 4 insertions(+) >=20 > diff --git a/SignedCapsulePkg/Library/IniParsingLib/IniParsingLib.c > b/SignedCapsulePkg/Library/IniParsingLib/IniParsingLib.c > index a8773c1..5c975f7 100644 > --- a/SignedCapsulePkg/Library/IniParsingLib/IniParsingLib.c > +++ b/SignedCapsulePkg/Library/IniParsingLib/IniParsingLib.c > @@ -1257,6 +1257,7 @@ GetGuidFromDataFile ( > if (EFI_ERROR(Status)) { > return EFI_NOT_FOUND; > } > + ASSERT (Value !=3D NULL); > if (!IsValidGuid(Value, AsciiStrLen(Value))) { > return EFI_NOT_FOUND; > } > @@ -1303,6 +1304,7 @@ GetDecimalUintnFromDataFile ( > if (EFI_ERROR(Status)) { > return EFI_NOT_FOUND; > } > + ASSERT (Value !=3D NULL); > if (!IsValidDecimalString(Value, AsciiStrLen(Value))) { > return EFI_NOT_FOUND; > } > @@ -1346,6 +1348,7 @@ GetHexUintnFromDataFile ( > if (EFI_ERROR(Status)) { > return EFI_NOT_FOUND; > } > + ASSERT (Value !=3D NULL); > if (!IsValidHexString(Value, AsciiStrLen(Value))) { > return EFI_NOT_FOUND; > } > @@ -1389,6 +1392,7 @@ GetHexUint64FromDataFile ( > if (EFI_ERROR(Status)) { > return EFI_NOT_FOUND; > } > + ASSERT (Value !=3D NULL); > if (!IsValidHexString(Value, AsciiStrLen(Value))) { > return EFI_NOT_FOUND; > } > -- > 1.9.5.msysgit.0