[edk2-devel] [PATCH EDK2 v2 1/1] SecurityPkg/FvReportPei: remove redundant sizeof

Yao, Jiewen jiewen.yao at intel.com
Wed Apr 14 01:55:34 UTC 2021


It seems typo. I will let Jian to double confirm.

Acked-by: Jiewen Yao <Jiewen.yao at intel.com>



> -----Original Message-----
> From: devel at edk2.groups.io <devel at edk2.groups.io> On Behalf Of wenyi,xie
> via groups.io
> Sent: Wednesday, April 14, 2021 9:44 AM
> To: devel at edk2.groups.io; Yao, Jiewen <jiewen.yao at intel.com>; Wang, Jian J
> <jian.j.wang at intel.com>; lersek at redhat.com
> Cc: songdongkuang at huawei.com; xiewenyi2 at huawei.com
> Subject: [edk2-devel] [PATCH EDK2 v2 1/1] 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 at intel.com>
> Cc: Jian J Wang <jian.j.wang at intel.com>
> Cc: Laszlo Ersek <lersek at redhat.com>
> Signed-off-by: Wenyi Xie <xiewenyi2 at huawei.com>
> Reviewed-by: Laszlo Ersek <lersek at redhat.com>
> ---
>  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 d709760ea3ce..e82413e090c0 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);
> --
> 2.20.1.windows.1
> 
> 
> 
> 
> 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#74075): https://edk2.groups.io/g/devel/message/74075
Mute This Topic: https://groups.io/mt/82081793/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-






More information about the edk2-devel-archive mailing list