Reviewed-by: Giri P Mudusuru <[email protected]>

> -----Original Message-----
> From: edk2-devel [mailto:[email protected]] On Behalf Of
> Hao Wu
> Sent: Wednesday, June 29, 2016 6:22 PM
> To: [email protected]
> Cc: Wu, Hao A <[email protected]>; Yao, Jiewen <[email protected]>
> Subject: [edk2] [PATCH] IntelFsp2WrapperPkg: Add NULL pointer check by
> using ASSERT()
> 
> Possible NULL pointer dereference for FspmHeaderPtr/FspsHeaderPtr in
> module FspmWrapperPeim/FspsWrapperPeim.
> 
> Cc: Jiewen Yao <[email protected]>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Hao Wu <[email protected]>
> ---
>  IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.c | 1 +
>  IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.c | 1 +
>  2 files changed, 2 insertions(+)
> 
> diff --git a/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.c
> b/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.c
> index 6144ad7..71157c3 100644
> --- a/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.c
> +++ b/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.c
> @@ -68,6 +68,7 @@ PeiFspMemoryInit (
>    // Copy default FSP-M UPD data from Flash
>    //
>    FspmHeaderPtr = (FSP_INFO_HEADER *)FspFindFspHeader (PcdGet32
> (PcdFspmBaseAddress));
> +  ASSERT (FspmHeaderPtr != NULL);
>    FspmUpdDataPtr = (FSPM_UPD_COMMON *)AllocateZeroPool
> ((UINTN)FspmHeaderPtr->CfgRegionSize);
>    ASSERT (FspmUpdDataPtr != NULL);
>    SourceData = (UINTN *)((UINTN)FspmHeaderPtr->ImageBase +
> (UINTN)FspmHeaderPtr->CfgRegionOffset);
> diff --git a/IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.c
> b/IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.c
> index 7a65ad7..3415629 100644
> --- a/IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.c
> +++ b/IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.c
> @@ -241,6 +241,7 @@ PeiMemoryDiscoveredNotify (
>    // Copy default FSP-S UPD data from Flash
>    //
>    FspsHeaderPtr = (FSP_INFO_HEADER *)FspFindFspHeader (PcdGet32
> (PcdFspsBaseAddress));
> +  ASSERT (FspsHeaderPtr != NULL);
>    FspsUpdDataPtr = (FSPS_UPD_COMMON *)AllocateZeroPool
> ((UINTN)FspsHeaderPtr->CfgRegionSize);
>    ASSERT (FspsUpdDataPtr != NULL);
>    SourceData = (UINTN *)((UINTN)FspsHeaderPtr->ImageBase +
> (UINTN)FspsHeaderPtr->CfgRegionOffset);
> --
> 1.9.5.msysgit.0
> 
> _______________________________________________
> edk2-devel mailing list
> [email protected]
> https://lists.01.org/mailman/listinfo/edk2-devel
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to