diff --git a/BootloaderCommonPkg/Library/ShellLib/CmdBoot.c b/BootloaderCommonPkg/Library/ShellLib/CmdBoot.c index 00f238bf..6e23dfd9 100644 --- a/BootloaderCommonPkg/Library/ShellLib/CmdBoot.c +++ b/BootloaderCommonPkg/Library/ShellLib/CmdBoot.c @@ -252,6 +252,7 @@ GetBootDeviceInfo ( @param[in] CurrOption the current boot entry value @retval EFI_SUCCESS + @retval EFI_NO_MAPPING LoadImageType is not a valid Image index value **/ EFI_STATUS @@ -267,6 +268,11 @@ GetBootFileInfo ( EFI_STATUS Status; UINTN Length; + if (LoadImageType >= LoadImageTypeMax) { + ShellPrint (L"Invalid LoadImageType '0x%X'\n", LoadImageType); + return EFI_NO_MAPPING; + } + do { if (LoadImageType == LoadImageTypeNormal){ ShellPrint (L"Enter file path string (max length of %d)\n",