]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sd-boot: Fix assertion fail
authorJan Janssen <medhefgo@web.de>
Sat, 11 Sep 2021 09:14:06 +0000 (11:14 +0200)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 11 Sep 2021 14:33:17 +0000 (23:33 +0900)
The UEFI Platform Initialization Specification says that both
parameters may be NULL.

src/boot/efi/shim.c

index 849598f1ce22ae05273e36984ec546b1b8dca509..e3fb073fdd9de45faaddf12635047f229cdfe492 100644 (file)
@@ -112,14 +112,13 @@ static EFIAPI EFI_STATUS security2_policy_authentication (const EFI_SECURITY2_PR
         EFI_STATUS status;
 
         assert(this);
-        assert(device_path);
-        assert(file_buffer);
+        /* device_path and file_buffer may be NULL */
 
         /* Chain original security policy */
         status = uefi_call_wrapper(es2fa, 5, this, device_path, file_buffer, file_size, boot_policy);
 
         /* if OK, don't bother with MOK check */
-        if (status == EFI_SUCCESS)
+        if (!EFI_ERROR(status))
                 return status;
 
         if (shim_validate(file_buffer, file_size))