mirror of https://github.com/acidanthera/audk.git
MdeModulePkg: Add ASSERT to make sure pointers are not NULL
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Eric Dong <eric.dong@intel.com>
This commit is contained in:
parent
1b96026e14
commit
d0d34cdf1d
|
@ -584,6 +584,7 @@ LibIsSupportedFileType (
|
||||||
}
|
}
|
||||||
|
|
||||||
TmpStr = AllocateCopyPool (StrSize (InputFileType), InputFileType);
|
TmpStr = AllocateCopyPool (StrSize (InputFileType), InputFileType);
|
||||||
|
ASSERT(TmpStr != NULL);
|
||||||
LibToLowerString(TmpStr);
|
LibToLowerString(TmpStr);
|
||||||
|
|
||||||
IsSupported = (StrStr (gFileExplorerPrivate.FileType, TmpStr) == NULL ? FALSE : TRUE);
|
IsSupported = (StrStr (gFileExplorerPrivate.FileType, TmpStr) == NULL ? FALSE : TRUE);
|
||||||
|
@ -1361,6 +1362,7 @@ ChooseFile (
|
||||||
gFileExplorerPrivate.ChooseHandler = ChooseHandler;
|
gFileExplorerPrivate.ChooseHandler = ChooseHandler;
|
||||||
if (FileType != NULL) {
|
if (FileType != NULL) {
|
||||||
gFileExplorerPrivate.FileType = AllocateCopyPool (StrSize (FileType), FileType);
|
gFileExplorerPrivate.FileType = AllocateCopyPool (StrSize (FileType), FileType);
|
||||||
|
ASSERT(gFileExplorerPrivate.FileType != NULL);
|
||||||
LibToLowerString(gFileExplorerPrivate.FileType);
|
LibToLowerString(gFileExplorerPrivate.FileType);
|
||||||
} else {
|
} else {
|
||||||
gFileExplorerPrivate.FileType = NULL;
|
gFileExplorerPrivate.FileType = NULL;
|
||||||
|
|
Loading…
Reference in New Issue