From: Jan Janssen Date: Thu, 16 Feb 2023 14:24:44 +0000 (+0100) Subject: boot: Fix assertion failure X-Git-Tag: v254-rc1~1261 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f92428eae53685f372775e8cb0f0f4c249f02724;p=thirdparty%2Fsystemd.git boot: Fix assertion failure The TPM code expects a description unless the PCR index indicates that no measurements have to take place. The assert was preempting this check from happening. Fixes: #26428 --- diff --git a/src/boot/efi/measure.c b/src/boot/efi/measure.c index a8bbc62eaae..949e26350c7 100644 --- a/src/boot/efi/measure.c +++ b/src/boot/efi/measure.c @@ -146,7 +146,7 @@ EFI_STATUS tpm_log_event(uint32_t pcrindex, EFI_PHYSICAL_ADDRESS buffer, size_t EFI_TCG2 *tpm2; EFI_STATUS err; - assert(description); + assert(description || pcrindex == UINT32_MAX); /* If EFI_SUCCESS is returned, will initialize ret_measured to true if we actually measured * something, or false if measurement was turned off. */