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:
James Gutbub 2021-08-31 14:12:08 -07:00 committed by GitHub
parent 878190fadf
commit 2bfdb8faac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -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",