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 2021B81C06 for ; Wed, 11 Jan 2017 21:26:06 -0800 (PST) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga102.fm.intel.com with ESMTP; 11 Jan 2017 21:26:06 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,348,1477983600"; d="scan'208";a="52895389" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by fmsmga006.fm.intel.com with ESMTP; 11 Jan 2017 21:26:06 -0800 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.248.2; Wed, 11 Jan 2017 21:26:05 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.88]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.177]) with mapi id 14.03.0248.002; Thu, 12 Jan 2017 13:26:03 +0800 From: "Yao, Jiewen" To: "Wu, Hao A" , "edk2-devel@lists.01.org" CC: "Zhang, Chao B" Thread-Topic: [PATCH] SignedCapsulePkg/CapsuleLib: Refine to compare with same type Thread-Index: AQHSZ/rIsj14RDuIr025tvKcF1RLKaE0WLvg Date: Thu, 12 Jan 2017 05:26:03 +0000 Message-ID: <74D8A39837DF1E4DA445A8C0B3885C503A8DF0D4@shsmsx102.ccr.corp.intel.com> References: <1483692987-28728-1-git-send-email-hao.a.wu@intel.com> In-Reply-To: <1483692987-28728-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/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: Thu, 12 Jan 2017 05:26:06 -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: Friday, January 6, 2017 4:56 PM > To: edk2-devel@lists.01.org > Cc: Wu, Hao A ; Zhang, Chao B ; > Yao, Jiewen > Subject: [PATCH] SignedCapsulePkg/CapsuleLib: Refine to compare with same > type >=20 > 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(-) >=20 > diff --git > a/SignedCapsulePkg/Library/EdkiiSystemCapsuleLib/EdkiiSystemCapsuleLib.c > b/SignedCapsulePkg/Library/EdkiiSystemCapsuleLib/EdkiiSystemCapsuleLib.c > index 1820551..dfd8d10 100644 > --- a/SignedCapsulePkg/Library/EdkiiSystemCapsuleLib/EdkiiSystemCapsuleLi= b.c > +++ > b/SignedCapsulePkg/Library/EdkiiSystemCapsuleLib/EdkiiSystemCapsuleLib.c > @@ -6,7 +6,7 @@ > CapsuleAuthenticateSystemFirmware(), ExtractAuthenticatedImage() will > receive > untrusted input and do basic validation. >=20 > - 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