[PATCH 3/4] lib: fwts_acpi_tables: add checking for empty table parsing
Colin King
colin.king at canonical.com
Tue Sep 8 07:00:48 UTC 2015
From: Colin Ian King <colin.king at canonical.com>
Signed-off-by: Colin Ian King <colin.king at canonical.com>
---
src/lib/src/fwts_acpi_tables.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/lib/src/fwts_acpi_tables.c b/src/lib/src/fwts_acpi_tables.c
index 1592791..3fa200b 100644
--- a/src/lib/src/fwts_acpi_tables.c
+++ b/src/lib/src/fwts_acpi_tables.c
@@ -655,6 +655,11 @@ static uint8_t *fwts_acpi_load_table_from_acpidump(
if (n != 16)
break;
}
+ /* Unlikely, but an empty table should be checked for */
+ if (!tmp) {
+ fwts_log_error(fw, "ACPI table parser found an empty table '%s'.", name);
+ return NULL;
+ }
/* Allocate the table using low 32 bit memory */
if ((table = fwts_low_malloc(len)) == NULL) {
--
2.5.0
More information about the fwts-devel
mailing list