From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (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 20D4E817BE for ; Fri, 6 Jan 2017 00:56:29 -0800 (PST) Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga101.fm.intel.com with ESMTP; 06 Jan 2017 00:56:28 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,323,1477983600"; d="scan'208";a="50165049" Received: from shwdeopenpsi014.ccr.corp.intel.com ([10.239.9.13]) by fmsmga005.fm.intel.com with ESMTP; 06 Jan 2017 00:56:27 -0800 From: Hao Wu To: edk2-devel@lists.01.org Cc: Hao Wu , Chao Zhang , Jiewen Yao Date: Fri, 6 Jan 2017 16:56:26 +0800 Message-Id: <1483692987-28728-1-git-send-email-hao.a.wu@intel.com> X-Mailer: git-send-email 1.9.5.msysgit.0 Subject: [PATCH] SignedCapsulePkg/CapsuleLib: Refine to compare with same type 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: Fri, 06 Jan 2017 08:56:29 -0000 Cc: Chao Zhang Cc: Jiewen Yao Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu --- .../Library/EdkiiSystemCapsuleLib/EdkiiSystemCapsuleLib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SignedCapsulePkg/Library/EdkiiSystemCapsuleLib/EdkiiSystemCapsuleLib.c b/SignedCapsulePkg/Library/EdkiiSystemCapsuleLib/EdkiiSystemCapsuleLib.c index 1820551..dfd8d10 100644 --- a/SignedCapsulePkg/Library/EdkiiSystemCapsuleLib/EdkiiSystemCapsuleLib.c +++ b/SignedCapsulePkg/Library/EdkiiSystemCapsuleLib/EdkiiSystemCapsuleLib.c @@ -6,7 +6,7 @@ CapsuleAuthenticateSystemFirmware(), ExtractAuthenticatedImage() will receive untrusted input and do basic validation. - Copyright (c) 2016, Intel Corporation. All rights reserved.
+ Copyright (c) 2016 - 2017, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -386,7 +386,7 @@ ExtractAuthenticatedImage ( DEBUG((DEBUG_ERROR, "ExtractAuthenticatedImage - dwLength too small\n")); return FALSE; } - if (ImageAuth->AuthInfo.Hdr.dwLength > MAX_UINTN - sizeof(UINT64)) { + if ((UINTN) ImageAuth->AuthInfo.Hdr.dwLength > MAX_UINTN - sizeof(UINT64)) { DEBUG((DEBUG_ERROR, "ExtractAuthenticatedImage - dwLength too big\n")); return FALSE; } -- 1.9.5.msysgit.0