From d0d34cdf1d2752f0d7c3ca41af7e7ed29c221d11 Mon Sep 17 00:00:00 2001 From: Dandan Bi Date: Mon, 29 Feb 2016 15:08:56 +0800 Subject: MdeModulePkg: Add ASSERT to make sure pointers are not NULL Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi Reviewed-by: Eric Dong --- MdeModulePkg/Library/FileExplorerLib/FileExplorer.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'MdeModulePkg') diff --git a/MdeModulePkg/Library/FileExplorerLib/FileExplorer.c b/MdeModulePkg/Library/FileExplorerLib/FileExplorer.c index 98c81db..9f75d6e 100644 --- a/MdeModulePkg/Library/FileExplorerLib/FileExplorer.c +++ b/MdeModulePkg/Library/FileExplorerLib/FileExplorer.c @@ -584,6 +584,7 @@ LibIsSupportedFileType ( } TmpStr = AllocateCopyPool (StrSize (InputFileType), InputFileType); + ASSERT(TmpStr != NULL); LibToLowerString(TmpStr); IsSupported = (StrStr (gFileExplorerPrivate.FileType, TmpStr) == NULL ? FALSE : TRUE); @@ -1361,6 +1362,7 @@ ChooseFile ( gFileExplorerPrivate.ChooseHandler = ChooseHandler; if (FileType != NULL) { gFileExplorerPrivate.FileType = AllocateCopyPool (StrSize (FileType), FileType); + ASSERT(gFileExplorerPrivate.FileType != NULL); LibToLowerString(gFileExplorerPrivate.FileType); } else { gFileExplorerPrivate.FileType = NULL; -- cgit v1.1