Felix Held has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/79393?usp=email )
Change subject: acpi/acpi: make sure that table_ptr is non-NULL in acpidump_print ......................................................................
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 felix-coreboot@felixheld.de Change-Id: Ic3cc103c8a47fb8c2fe4262236ea47013af27c4f --- M src/acpi/acpi.c 1 file changed, 2 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/93/79393/1
diff --git a/src/acpi/acpi.c b/src/acpi/acpi.c index e40d4ac..c4d55ab 100644 --- a/src/acpi/acpi.c +++ b/src/acpi/acpi.c @@ -1367,6 +1367,8 @@
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);