Resolve KW issue in boot command (#1280)
Boot command may attempt to use an index which exceeds the max image type. Check if the value is larger than the max allowed value and return if there is an error. Signed-off-by: James Gutbub <james.gutbub@intel.com>
This commit is contained in:
parent
878190fadf
commit
2bfdb8faac
|
@ -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",
|
||||
|
|
Loading…
Reference in New Issue