From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) (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 D005682360 for ; Wed, 21 Dec 2016 21:00:40 -0800 (PST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga104.jf.intel.com with ESMTP; 21 Dec 2016 21:00:40 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,386,1477983600"; d="scan'208";a="1085343529" Received: from jyao1-mobl.ccr.corp.intel.com ([10.239.193.137]) by fmsmga001.fm.intel.com with ESMTP; 21 Dec 2016 21:00:39 -0800 From: Jiewen Yao To: edk2-devel@lists.01.org Cc: Chao Zhang , Qin Long Date: Thu, 22 Dec 2016 13:00:29 +0800 Message-Id: <1482382829-12168-3-git-send-email-jiewen.yao@intel.com> X-Mailer: git-send-email 2.7.4.windows.1 In-Reply-To: <1482382829-12168-1-git-send-email-jiewen.yao@intel.com> References: <1482382829-12168-1-git-send-email-jiewen.yao@intel.com> Subject: [PATCH 2/2] SignedCapsulePkg/SystemCapsuleLib: Add ASSERT check for PCD 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: Thu, 22 Dec 2016 05:00:40 -0000 Add ASSERT check for PCD to avoid platform mis-configuration. Cc: Chao Zhang Cc: Qin Long Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiewen Yao --- SignedCapsulePkg/Library/EdkiiSystemCapsuleLib/EdkiiSystemCapsuleLib.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/SignedCapsulePkg/Library/EdkiiSystemCapsuleLib/EdkiiSystemCapsuleLib.c b/SignedCapsulePkg/Library/EdkiiSystemCapsuleLib/EdkiiSystemCapsuleLib.c index 27c6f4c..1820551 100644 --- a/SignedCapsulePkg/Library/EdkiiSystemCapsuleLib/EdkiiSystemCapsuleLib.c +++ b/SignedCapsulePkg/Library/EdkiiSystemCapsuleLib/EdkiiSystemCapsuleLib.c @@ -415,6 +415,8 @@ ExtractAuthenticatedImage ( } else { return FALSE; } + ASSERT (PublicKeyData != NULL); + ASSERT (PublicKeyDataLength != 0); Status = AuthenticateFmpImage( ImageAuth, -- 2.7.4.windows.1