From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (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 4315A81C06 for ; Wed, 11 Jan 2017 21:25:00 -0800 (PST) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga105.jf.intel.com with ESMTP; 11 Jan 2017 21:25:00 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,348,1477983600"; d="scan'208";a="48028189" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by orsmga004.jf.intel.com with ESMTP; 11 Jan 2017 21:25:00 -0800 Received: from fmsmsx120.amr.corp.intel.com (10.18.124.208) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.248.2; Wed, 11 Jan 2017 21:24:59 -0800 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by fmsmsx120.amr.corp.intel.com (10.18.124.208) with Microsoft SMTP Server (TLS) id 14.3.248.2; Wed, 11 Jan 2017 21:24:59 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.88]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.204]) with mapi id 14.03.0248.002; Thu, 12 Jan 2017 13:24:56 +0800 From: "Yao, Jiewen" To: "Wu, Hao A" , "edk2-devel@lists.01.org" CC: "Zhang, Chao B" Thread-Topic: [PATCH] SecurityPkg/TcgDxe: Refine to compare 2 values with the same type Thread-Index: AQHSZ/qSJW4uj+lDs0yCOXX0SLtSw6E0WGLA Date: Thu, 12 Jan 2017 05:24:55 +0000 Message-ID: <74D8A39837DF1E4DA445A8C0B3885C503A8DF0A1@shsmsx102.ccr.corp.intel.com> References: <1483692893-33968-1-git-send-email-hao.a.wu@intel.com> In-Reply-To: <1483692893-33968-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] SecurityPkg/TcgDxe: Refine to compare 2 values with the 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:25:00 -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:55 PM > To: edk2-devel@lists.01.org > Cc: Wu, Hao A ; Zhang, Chao B ; > Yao, Jiewen > Subject: [PATCH] SecurityPkg/TcgDxe: Refine to compare 2 values with the = same > type >=20 > Cc: Chao Zhang > Cc: Jiewen Yao > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Hao Wu > --- > SecurityPkg/Tcg/TcgDxe/TcgDxe.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) >=20 > diff --git a/SecurityPkg/Tcg/TcgDxe/TcgDxe.c b/SecurityPkg/Tcg/TcgDxe/Tcg= Dxe.c > index f7bf79a..5b7c5c3 100644 > --- a/SecurityPkg/Tcg/TcgDxe/TcgDxe.c > +++ b/SecurityPkg/Tcg/TcgDxe/TcgDxe.c > @@ -8,7 +8,7 @@ buffer overflow, integer overflow. >=20 > TcgDxePassThroughToTpm() will receive untrusted input and do basic valid= ation. >=20 > -Copyright (c) 2005 - 2016, Intel Corporation. All rights reserved.
> +Copyright (c) 2005 - 2017, Intel Corporation. All rights reserved.
> (C) Copyright 2016 Hewlett Packard Enterprise Development LP
> This program and the accompanying materials > are licensed and made available under the terms and conditions of the BS= D > License > @@ -395,7 +395,7 @@ TpmCommLogEvent ( > // > // Prevent Event Overflow > // > - if (NewEventHdr->EventSize > (UINTN)(~0) - sizeof (*NewEventHdr)) { > + if ((UINTN) NewEventHdr->EventSize > MAX_UINTN - sizeof > (*NewEventHdr)) { > return EFI_OUT_OF_RESOURCES; > } >=20 > -- > 1.9.5.msysgit.0