diff --git a/src/pcrlock/pcrlock.c b/src/pcrlock/pcrlock.c index 53b9b8a1551..8b4ebceeb65 100644 --- a/src/pcrlock/pcrlock.c +++ b/src/pcrlock/pcrlock.c @@ -837,7 +837,9 @@ static int event_log_record_extract_firmware_description(EventLogRecord *rec) { goto invalid; } - if (left < offsetof(packed_EFI_DEVICE_PATH, path) || left < dp->length) { + if (left < offsetof(packed_EFI_DEVICE_PATH, path) || + dp->length < offsetof(packed_EFI_DEVICE_PATH, path) || + left < dp->length) { log_warning("Device path element too short, ignoring."); goto invalid; }