]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg: Add ASSERT to make sure pointers are not NULL
authorDandan Bi <dandan.bi@intel.com>
Mon, 29 Feb 2016 07:08:56 +0000 (15:08 +0800)
committerFeng Tian <feng.tian@intel.com>
Wed, 2 Mar 2016 07:18:56 +0000 (15:18 +0800)
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
MdeModulePkg/Library/FileExplorerLib/FileExplorer.c

index 98c81dbef9e5b46e7f7519b2a819e0b434cfebf6..9f75d6ede544080eec8fc8a8ad602ab6d56b8519 100644 (file)
@@ -584,6 +584,7 @@ LibIsSupportedFileType (
   }\r
 \r
   TmpStr = AllocateCopyPool (StrSize (InputFileType), InputFileType);\r
+  ASSERT(TmpStr != NULL);\r
   LibToLowerString(TmpStr);\r
 \r
   IsSupported = (StrStr (gFileExplorerPrivate.FileType, TmpStr) == NULL ? FALSE : TRUE);\r
@@ -1361,6 +1362,7 @@ ChooseFile (
   gFileExplorerPrivate.ChooseHandler = ChooseHandler;\r
   if (FileType != NULL) {\r
     gFileExplorerPrivate.FileType = AllocateCopyPool (StrSize (FileType), FileType);\r
+    ASSERT(gFileExplorerPrivate.FileType != NULL);\r
     LibToLowerString(gFileExplorerPrivate.FileType);\r
   } else {\r
     gFileExplorerPrivate.FileType = NULL;\r