summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWenyi Xie <xiewenyi2@huawei.com>2021-04-14 09:43:50 +0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2021-04-16 08:39:59 +0000
commit99e7e48cc7117c37fc1c08a741872d0875595796 (patch)
treebec2e5c614859ba8edc07c50b066ca27b00fda39
parent9abc447b725ea09f221be918e8ce3101d2e93234 (diff)
downloadedk2-99e7e48cc7117c37fc1c08a741872d0875595796.zip
edk2-99e7e48cc7117c37fc1c08a741872d0875595796.tar.gz
edk2-99e7e48cc7117c37fc1c08a741872d0875595796.tar.bz2
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 <jiewen.yao@intel.com> Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Wenyi Xie <xiewenyi2@huawei.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jian J Wang <jian.j.wang@intel.com> Acked-by: Jiewen Yao <Jiewen.yao@intel.com>
-rw-r--r--SecurityPkg/FvReportPei/FvReportPei.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/SecurityPkg/FvReportPei/FvReportPei.c b/SecurityPkg/FvReportPei/FvReportPei.c
index d709760..e82413e 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);