From 15720d03400f3e0a3b87f0fd7f54ac9f657c7a41 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Mon, 3 Sep 2018 13:57:54 +0200 Subject: [PATCH] boot/efi/stub.c: fix Dell LoadOptions On Dell machines LoadOptions is filled with: 01 00 00 00 ... So, in case of meaningfull LoadOptions, better check if the first char is a printable character. --- src/boot/efi/stub.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/boot/efi/stub.c b/src/boot/efi/stub.c index 15cdfca2a3..5c97b54691 100644 --- a/src/boot/efi/stub.c +++ b/src/boot/efi/stub.c @@ -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; -- 2.25.1