From 67b3c8f278312768a25f0ad07569e22288d0a11f Mon Sep 17 00:00:00 2001 From: Felix Held Date: Thu, 3 Aug 2023 01:08:14 +0200 Subject: acpi/acpi: make sure that table_ptr is non-NULL in acpidump_print While acpidump_print shouldn't be called with a NULL pointer as table_ptr argument, better add a check to not end up dereferencing the NULL pointer. Signed-off-by: Felix Held Change-Id: Ic3cc103c8a47fb8c2fe4262236ea47013af27c4f Reviewed-on: https://review.coreboot.org/c/coreboot/+/79393 Tested-by: build bot (Jenkins) Reviewed-by: Tim Wawrzynczak --- src/acpi/acpi.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/acpi/acpi.c b/src/acpi/acpi.c index e40d4ac9aa..c4d55ab453 100644 --- a/src/acpi/acpi.c +++ b/src/acpi/acpi.c @@ -1367,6 +1367,8 @@ static void acpixtract_compatible_hexdump(const void *memory, size_t length) static void acpidump_print(void *table_ptr) { + if (table_ptr == NULL) + return; const acpi_header_t *header = (acpi_header_t *)table_ptr; const size_t table_size = header->length; printk(BIOS_SPEW, "%.4s @ 0x0000000000000000\n", header->signature); -- cgit v1.2.3