From: Jan Janssen Date: Sat, 11 Sep 2021 09:14:06 +0000 (+0200) Subject: sd-boot: Fix assertion fail X-Git-Tag: v250-rc1~696 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=de829ff59363d83bfc165a404cefa7fa3b20f16a;p=thirdparty%2Fsystemd.git sd-boot: Fix assertion fail The UEFI Platform Initialization Specification says that both parameters may be NULL. --- diff --git a/src/boot/efi/shim.c b/src/boot/efi/shim.c index 849598f1ce2..e3fb073fdd9 100644 --- a/src/boot/efi/shim.c +++ b/src/boot/efi/shim.c @@ -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))