From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (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 1ADA581E8B for ; Wed, 16 Nov 2016 00:26:06 -0800 (PST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga105.fm.intel.com with ESMTP; 16 Nov 2016 00:26:10 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,647,1473145200"; d="scan'208";a="1085915852" Received: from shwdeopenpsi014.ccr.corp.intel.com ([10.239.9.34]) by fmsmga002.fm.intel.com with ESMTP; 16 Nov 2016 00:26:09 -0800 From: Hao Wu To: edk2-devel@lists.01.org Cc: Hao Wu , Jiewen Yao Date: Wed, 16 Nov 2016 16:26:01 +0800 Message-Id: <1479284761-15060-1-git-send-email-hao.a.wu@intel.com> X-Mailer: git-send-email 1.9.5.msysgit.0 Subject: [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:26:06 -0000 Function GetStringFromDataFile() ensures its fourth (output) parameter will not be NULL when the return status is EFI_SUCCESS. This commit adds ASSERT as warnings for the case that will not happen. 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(+) 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 != 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 != 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 != 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 != NULL); if (!IsValidHexString(Value, AsciiStrLen(Value))) { return EFI_NOT_FOUND; } -- 1.9.5.msysgit.0