ACK: [PATCH 3/4] lib: fwts_acpi_tables: add checking for empty table parsing

Alex Hung alex.hung at canonical.com
Wed Sep 9 03:21:53 UTC 2015


On 09/08/2015 03:00 PM, Colin King wrote:
> 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) {
> 

Acked-by: Alex Hung <alex.hung at canonical.com>



More information about the fwts-devel mailing list