summaryrefslogtreecommitdiff
path: root/SecurityPkg
diff options
context:
space:
mode:
authorHao Wu <hao.a.wu@intel.com>2016-11-21 15:38:11 +0800
committerHao Wu <hao.a.wu@intel.com>2016-11-22 16:31:58 +0800
commit36e9e3e8ea0ce477504b6d2e21603ea94847efae (patch)
tree8c21409713f2a809db237f2db90a8f52330fb66a /SecurityPkg
parenta8bcbf9c4d677c392e24893b86944e2cdeb8719e (diff)
downloadedk2-36e9e3e8ea0ce477504b6d2e21603ea94847efae.zip
edk2-36e9e3e8ea0ce477504b6d2e21603ea94847efae.tar.gz
edk2-36e9e3e8ea0ce477504b6d2e21603ea94847efae.tar.bz2
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 <jiewen.yao@intel.com> Cc: Chao Zhang <chao.b.zhang@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> Reviewed-by: Chao Zhang <chao.b.zhang@intel.com>
Diffstat (limited to 'SecurityPkg')
-rw-r--r--SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c b/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c
index 6241c52..9e8dfae 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,