Reviewed-by: Eric Dong <eric.d...@intel.com>

> -----Original Message-----
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Dandan 
> Bi
> Sent: Tuesday, March 01, 2016 10:52 AM
> To: edk2-devel@lists.01.org
> Cc: Qiu, Shumin; Dong, Eric
> Subject: [edk2] [patch] MdeModulePkg: Add ASSERT to make sure pointers are 
> not NULL
> 
> Cc: Qiu Shumin <shumin....@intel.com>
> Cc: Eric Dong <eric.d...@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Dandan Bi <dandan...@intel.com>
> ---
>  MdeModulePkg/Library/FileExplorerLib/FileExplorer.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/MdeModulePkg/Library/FileExplorerLib/FileExplorer.c 
> b/MdeModulePkg/Library/FileExplorerLib/FileExplorer.c
> index 9714dbc..f985b44 100644
> --- a/MdeModulePkg/Library/FileExplorerLib/FileExplorer.c
> +++ b/MdeModulePkg/Library/FileExplorerLib/FileExplorer.c
> @@ -578,10 +578,11 @@ LibIsSupportedFileType (
>    if (InputFileType == NULL) {
>      return TRUE;
>    }
> 
>    TmpStr = AllocateCopyPool (StrSize (InputFileType), InputFileType);
> +  ASSERT(TmpStr != NULL);
>    LibToLowerString(TmpStr);
> 
>    IsSupported = (StrStr (gFileExplorerPrivate.FileType, TmpStr) == NULL ? 
> FALSE : TRUE);
> 
>    FreePool (TmpStr);
> @@ -1355,10 +1356,11 @@ ChooseFile (
> 
>    gFileExplorerPrivate.RetDevicePath = NULL;
>    gFileExplorerPrivate.ChooseHandler = ChooseHandler;
>    if (FileType != NULL) {
>      gFileExplorerPrivate.FileType = AllocateCopyPool (StrSize (FileType), 
> FileType);
> +    ASSERT(gFileExplorerPrivate.FileType != NULL);
>      LibToLowerString(gFileExplorerPrivate.FileType);
>    } else {
>      gFileExplorerPrivate.FileType = NULL;
>    }
> 
> --
> 1.9.5.msysgit.1
> 
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to