SecurityPkg: Tcg2Dxe: Fix undersized TempBuf
authorZhang, Chao B <chao.b.zhang@intel.com>
Thu, 31 Mar 2016 01:40:28 +0000 (09:40 +0800)
committerZhang, Chao B <chao.b.zhang@intel.com>
Thu, 31 Mar 2016 01:41:03 +0000 (09:41 +0800)
TempBuf in SetupEventLog needs to include sizeof(UINT32) to hold NumberOfAlgorithms.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Thomas Palmer <thomas.palmer@hpe.com>
Reviewed-by: Yao Jiewen <jiewen.yao@intel.com>
Reviewed-by: Chao Zhang <chao.b.zhang@intel.com>
Reviewed-by: El-Haj-Mahmoud Samer <samer.el-haj-mahmoud@hpe.com>
SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c

index b1c885e407bc17beb12b0cac6883e7eddbd8f917..07f76af90f6e4cb90a33045736a076ef0d8b6939 100644 (file)
@@ -1482,7 +1482,7 @@ SetupEventLog (
   UINT32                          DigestListBinSize;\r
   UINT32                          EventSize;\r
   TCG_EfiSpecIDEventStruct        *TcgEfiSpecIdEventStruct;\r
-  UINT8                           TempBuf[sizeof(TCG_EfiSpecIDEventStruct) + (HASH_COUNT * sizeof(TCG_EfiSpecIdEventAlgorithmSize)) + sizeof(UINT8)];\r
+  UINT8                           TempBuf[sizeof(TCG_EfiSpecIDEventStruct) + sizeof(UINT32) + (HASH_COUNT * sizeof(TCG_EfiSpecIdEventAlgorithmSize)) + sizeof(UINT8)];\r
   TCG_PCR_EVENT_HDR               FirstPcrEvent;\r
   TCG_EfiSpecIdEventAlgorithmSize *DigestSize;\r
   TCG_EfiSpecIdEventAlgorithmSize *TempDigestSize;\r