From: Hao Wu Date: Mon, 21 Nov 2016 07:38:11 +0000 (+0800) Subject: SecurityPkg Tcg2Dxe: ASSERT to ensure 'VarData' is not NULL X-Git-Tag: edk2-stable201903~5111 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=36e9e3e8ea0ce477504b6d2e21603ea94847efae SecurityPkg Tcg2Dxe: ASSERT to ensure 'VarData' is not NULL 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 Reviewed-by: Jiewen Yao Reviewed-by: Chao Zhang --- diff --git a/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c b/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c index 6241c5208b..9e8dfae6cc 100644 --- a/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c +++ b/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c @@ -1803,6 +1803,7 @@ MeasureVariable ( (UINT8*)VarLog ); } else { + ASSERT (VarData != NULL); Status = TcgDxeHashLogExtendEvent ( 0, (UINT8*)VarData,