From: Harald Hoyer Date: Mon, 3 Sep 2018 11:57:54 +0000 (+0200) Subject: boot/efi/stub.c: fix Dell LoadOptions X-Git-Tag: v240~767 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=15720d03400f3e0a3b87f0fd7f54ac9f657c7a41;p=thirdparty%2Fsystemd.git 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. --- diff --git a/src/boot/efi/stub.c b/src/boot/efi/stub.c index 15cdfca2a33..5c97b54691c 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;