diff options
Diffstat (limited to 'ShellPkg/Library/UefiShellDebug1CommandsLib/LoadPciRom.c')
-rw-r--r-- | ShellPkg/Library/UefiShellDebug1CommandsLib/LoadPciRom.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/LoadPciRom.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/LoadPciRom.c index 852d6dcf80..3fc635c254 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/LoadPciRom.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/LoadPciRom.c @@ -302,6 +302,11 @@ LoadEfiDriversFromRomImage ( );
if (!EFI_ERROR (Status)) {
DecompressedImageBuffer = AllocateZeroPool (DestinationSize);
+ if (DecompressedImageBuffer == NULL) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_OUT_MEM), gShellDebug1HiiHandle, L"loadpcirom");
+ return EFI_OUT_OF_RESOURCES;
+ }
+
if (ImageBuffer != NULL) {
Scratch = AllocateZeroPool (ScratchSize);
if (Scratch != NULL) {
@@ -333,6 +338,10 @@ LoadEfiDriversFromRomImage ( //
UnicodeSPrint (RomFileName, sizeof (RomFileName), L"%s[%d]", FileName, ImageIndex);
FilePath = FileDevicePath (NULL, RomFileName);
+ if (FilePath == NULL) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_LOADPCIROM_LOAD_FAIL), gShellDebug1HiiHandle, L"loadpcirom", FileName, ImageIndex);
+ return EFI_OUT_OF_RESOURCES;
+ }
Status = gBS->LoadImage (
TRUE,
|