From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) (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 0181181D81 for ; Sun, 20 Nov 2016 23:57:23 -0800 (PST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga103.fm.intel.com with ESMTP; 20 Nov 2016 23:57:23 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,674,1473145200"; d="scan'208";a="788971187" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by FMSMGA003.fm.intel.com with ESMTP; 20 Nov 2016 23:57:22 -0800 Received: from fmsmsx157.amr.corp.intel.com (10.18.116.73) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.248.2; Sun, 20 Nov 2016 23:57:22 -0800 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by FMSMSX157.amr.corp.intel.com (10.18.116.73) with Microsoft SMTP Server (TLS) id 14.3.248.2; Sun, 20 Nov 2016 23:57:21 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.239]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.239]) with mapi id 14.03.0248.002; Mon, 21 Nov 2016 15:57:20 +0800 From: "Yao, Jiewen" To: "Wu, Hao A" , "edk2-devel@lists.01.org" CC: "Zhang, Chao B" Thread-Topic: [PATCH] SecurityPkg Tcg2Dxe: ASSERT to ensure 'VarData' is not NULL Thread-Index: AQHSQ8xWdmnYvGAxb0CVd51+VR7DWKDjEiDQ Date: Mon, 21 Nov 2016 07:57:19 +0000 Message-ID: <74D8A39837DF1E4DA445A8C0B3885C50386D8129@shsmsx102.ccr.corp.intel.com> References: <1479714790-8016-1-git-send-email-hao.a.wu@intel.com> In-Reply-To: <1479714790-8016-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 Tcg2Dxe: ASSERT to ensure 'VarData' 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: Mon, 21 Nov 2016 07:57:24 -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: Monday, November 21, 2016 3:53 PM > To: edk2-devel@lists.01.org > Cc: Wu, Hao A ; Yao, Jiewen ; > Zhang, Chao B > Subject: [PATCH] SecurityPkg Tcg2Dxe: ASSERT to ensure 'VarData' is not > NULL >=20 > The logic in functions ReadAndMeasureVariable() and MeasureVariable() > within Tcg2Dxe ensure that 'VarData' will not be NULL before calling > TcgDxeHashLogExtendEvent() at line 1716. >=20 > This commit adds ASSERT as warnings for the case that will not happen. >=20 > Cc: Jiewen Yao > Cc: Chao Zhang > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Hao Wu > --- > SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c | 1 + > 1 file changed, 1 insertion(+) >=20 > diff --git a/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c > b/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c > index f0545a6..6a350e2 100644 > --- a/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c > +++ b/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c > @@ -1713,6 +1713,7 @@ MeasureVariable ( > (UINT8*)VarLog > ); > } else { > + ASSERT (VarData !=3D NULL); > Status =3D TcgDxeHashLogExtendEvent ( > 0, > (UINT8*)VarData, > -- > 1.9.5.msysgit.0