Martin L Roth has submitted this change. ( 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 Reviewed-on: https://review.coreboot.org/c/coreboot/+/79393 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Tim Wawrzynczak inforichland@gmail.com --- M src/acpi/acpi.c 1 file changed, 2 insertions(+), 0 deletions(-)
Approvals: Tim Wawrzynczak: Looks good to me, approved build bot (Jenkins): Verified
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);