From: Zhang, Chao B Date: Thu, 31 Mar 2016 01:40:28 +0000 (+0800) Subject: SecurityPkg: Tcg2Dxe: Fix undersized TempBuf X-Git-Tag: edk2-stable201903~7463 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=9381e149ad72d3f3e942b7734ebff70533dc7699 SecurityPkg: Tcg2Dxe: Fix undersized TempBuf TempBuf in SetupEventLog needs to include sizeof(UINT32) to hold NumberOfAlgorithms. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Thomas Palmer Reviewed-by: Yao Jiewen Reviewed-by: Chao Zhang Reviewed-by: El-Haj-Mahmoud Samer --- diff --git a/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c b/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c index b1c885e407..07f76af90f 100644 --- a/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c +++ b/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c @@ -1482,7 +1482,7 @@ SetupEventLog ( UINT32 DigestListBinSize; UINT32 EventSize; TCG_EfiSpecIDEventStruct *TcgEfiSpecIdEventStruct; - UINT8 TempBuf[sizeof(TCG_EfiSpecIDEventStruct) + (HASH_COUNT * sizeof(TCG_EfiSpecIdEventAlgorithmSize)) + sizeof(UINT8)]; + UINT8 TempBuf[sizeof(TCG_EfiSpecIDEventStruct) + sizeof(UINT32) + (HASH_COUNT * sizeof(TCG_EfiSpecIdEventAlgorithmSize)) + sizeof(UINT8)]; TCG_PCR_EVENT_HDR FirstPcrEvent; TCG_EfiSpecIdEventAlgorithmSize *DigestSize; TCG_EfiSpecIdEventAlgorithmSize *TempDigestSize;