From 2fbadaa95fc9116b5fc08200428e216278b147bb Mon Sep 17 00:00:00 2001 From: Richard Hughes Date: Wed, 13 Jul 2022 09:12:25 +0100 Subject: [PATCH] acpi-phat: Fix a critical warning when parsing an invalid PHAT record See https://oss-fuzz.com/testcase-detail/6099569951244288 for details. --- plugins/acpi-phat/fu-acpi-phat-health-record.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/acpi-phat/fu-acpi-phat-health-record.c b/plugins/acpi-phat/fu-acpi-phat-health-record.c index c8edf5831..21ccabc92 100644 --- a/plugins/acpi-phat/fu-acpi-phat-health-record.c +++ b/plugins/acpi-phat/fu-acpi-phat-health-record.c @@ -103,7 +103,7 @@ fu_acpi_phat_health_record_parse(FuFirmware *firmware, } /* check this is an even number of bytes */ - if (ubufsz % 2 != 0) { + if (ubufsz == 0 || ubufsz % 2 != 0) { g_set_error(error, G_IO_ERROR, G_IO_ERROR_INVALID_DATA,