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 2944481C64 for ; Mon, 21 Nov 2016 17:29:26 -0800 (PST) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga103.fm.intel.com with ESMTP; 21 Nov 2016 17:29:25 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,678,1473145200"; d="scan'208";a="33280248" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga004.jf.intel.com with ESMTP; 21 Nov 2016 17:29:25 -0800 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 21 Nov 2016 17:29:25 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.239]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.142]) with mapi id 14.03.0248.002; Tue, 22 Nov 2016 09:29:24 +0800 From: "Zhang, Chao B" To: "Wu, Hao A" , "edk2-devel@lists.01.org" CC: "Yao, Jiewen" Thread-Topic: [PATCH] SecurityPkg Tcg2Dxe: ASSERT to ensure 'VarData' is not NULL Thread-Index: AQHSQ8xWWioOpxV09keD78iocv+JLaDkOAVw Date: Tue, 22 Nov 2016 01:29:23 +0000 Message-ID: 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: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_IC x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNTRjNGE1NTAtYmNiMC00Y2E4LTllYTItNzk5OTdhMmMyOGRhIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6IjZKK3RjYWYyVDdtYTk4dUdPem1FZzVQWWpkSjViVm9HVW01NzhETzNcLzRJPSJ9 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: Tue, 22 Nov 2016 01:29:26 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by : Chao Zhang Thanks & Best regards Chao Zhang -----Original Message----- From: Wu, Hao A=20 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 NUL= L The logic in functions ReadAndMeasureVariable() and MeasureVariable() within Tcg2Dxe ensure that 'VarData' will not be NULL before calling TcgDxeHashLogExtendEvent() at line 1716. This commit adds ASSERT as warnings for the case that will not happen. 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(+) diff --git a/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c b/SecurityPkg/Tcg/Tcg2Dxe/Tc= g2Dxe.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, --=20 1.9.5.msysgit.0