]> git.proxmox.com Git - mirror_edk2.git/commitdiff
SecurityPkg Tcg2Dxe: ASSERT to ensure 'VarData' is not NULL
authorHao Wu <hao.a.wu@intel.com>
Mon, 21 Nov 2016 07:38:11 +0000 (15:38 +0800)
committerHao Wu <hao.a.wu@intel.com>
Tue, 22 Nov 2016 08:31:58 +0000 (16:31 +0800)
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>
SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c

index 6241c5208b484c441ac0a2c602455246077b2a01..9e8dfae6cc66af3fa2dece5615bc24e288a36cbe 100644 (file)
@@ -1803,6 +1803,7 @@ MeasureVariable (
                (UINT8*)VarLog\r
                );\r
   } else {\r
+    ASSERT (VarData != NULL);\r
     Status = TcgDxeHashLogExtendEvent (\r
                0,\r
                (UINT8*)VarData,\r