From 99e7e48cc7117c37fc1c08a741872d0875595796 Mon Sep 17 00:00:00 2001 From: Wenyi Xie Date: Wed, 14 Apr 2021 09:43:50 +0800 Subject: SecurityPkg/FvReportPei: remove redundant sizeof REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3333 In function InstallPreHashFvPpi, when calculating the size of struct HASH_INFO, sizeof is used twice. This bug does not lead to buffer overflow, "sizeof (HASH_INFO)" is 4, whereas "sizeof (sizeof (HASH_INFO))" is 4 or 8. Cc: Jiewen Yao Cc: Jian J Wang Cc: Laszlo Ersek Signed-off-by: Wenyi Xie Reviewed-by: Laszlo Ersek Reviewed-by: Jian J Wang Acked-by: Jiewen Yao --- SecurityPkg/FvReportPei/FvReportPei.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SecurityPkg/FvReportPei/FvReportPei.c b/SecurityPkg/FvReportPei/FvReportPei.c index d709760ea3..e82413e090 100644 --- a/SecurityPkg/FvReportPei/FvReportPei.c +++ b/SecurityPkg/FvReportPei/FvReportPei.c @@ -67,7 +67,7 @@ InstallPreHashFvPpi ( HASH_INFO *HashInfo; PpiSize = sizeof (EDKII_PEI_FIRMWARE_VOLUME_INFO_PREHASHED_FV_PPI) - + sizeof (sizeof (HASH_INFO)) + + sizeof (HASH_INFO) + HashSize; PreHashedFvPpi = AllocatePool (PpiSize); -- cgit v1.2.3