diff --git a/src/pcrlock/pcrlock.c b/src/pcrlock/pcrlock.c index 438c459582b4d..af1b55461dd1c 100644 --- a/src/pcrlock/pcrlock.c +++ b/src/pcrlock/pcrlock.c @@ -777,6 +777,16 @@ static int event_log_record_extract_firmware_description(EventLogRecord *rec) { const packed_EFI_DEVICE_PATH *dp = (const packed_EFI_DEVICE_PATH*) load->devicePath; size_t left = load->lengthOfDevicePath; + /* device path could be empty. Don't mark that as invalid but leave as don't know. + * Happens eg with shim https://github.com/rhboot/shim/issues/642 */ + if (left == 0) { + rec->description = strdup("File:"); + if (!rec->description) + return log_oom(); + + return 1; + } + for (;;) { if (left == 0) { if (!end) {