boot/efi/stub.c: fix Dell LoadOptions

On Dell machines LoadOptions is filled with:
01 00 00 00 <name of BIOS Boot Loader Entry> ... <unknown bytes>

So, in case of meaningfull LoadOptions, better check if the first char
is a printable character.
This commit is contained in:
Harald Hoyer 2018-09-03 13:57:54 +02:00 committed by Zbigniew Jędrzejewski-Szmek
parent 81375d8026
commit 15720d0340
1 changed files with 1 additions and 1 deletions

View File

@ -68,7 +68,7 @@ EFI_STATUS efi_main(EFI_HANDLE image, EFI_SYSTEM_TABLE *sys_table) {
cmdline_len = szs[0];
/* if we are not in secure boot mode, accept a custom command line and replace the built-in one */
if (!secure && loaded_image->LoadOptionsSize > 0 && *(CHAR16 *)loaded_image->LoadOptions != 0) {
if (!secure && loaded_image->LoadOptionsSize > 0 && *(CHAR16 *)loaded_image->LoadOptions > 0x1F) {
CHAR16 *options;
CHAR8 *line;
UINTN i;