Patchwork apci: acpidump: fix segfault when dumping ASF! tables (LP: #1188209)

login
register
mail settings
Submitter Colin King
Date June 6, 2013, 2:18 p.m.
Message ID <1370528338-8080-1-git-send-email-colin.king@canonical.com>
Download mbox | patch
Permalink /patch/249431/
State Accepted
Headers show

Comments

Colin King - June 6, 2013, 2:18 p.m.
From: Colin Ian King <colin.king@canonical.com>

We're missing a NULL terminator to asf_header_fields which causes
ASF! headers to cause a segfault.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 src/acpi/acpidump/acpidump.c | 1 +
 1 file changed, 1 insertion(+)
Ivan Hu - June 10, 2013, 7:18 a.m.
On 06/06/2013 10:18 PM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> We're missing a NULL terminator to asf_header_fields which causes
> ASF! headers to cause a segfault.
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>   src/acpi/acpidump/acpidump.c | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/src/acpi/acpidump/acpidump.c b/src/acpi/acpidump/acpidump.c
> index d95c166..51132f5 100644
> --- a/src/acpi/acpidump/acpidump.c
> +++ b/src/acpi/acpidump/acpidump.c
> @@ -1189,6 +1189,7 @@ static void acpidump_asf(fwts_framework *fw, fwts_acpi_table_info *table)
>   		FIELD_UINT("Type", fwts_acpi_table_asf_header, type),
>   		FIELD_UINT("Reserved", fwts_acpi_table_asf_header, reserved),
>   		FIELD_UINT("Length", fwts_acpi_table_asf_header, length),
> +		FIELD_END
>   	};
>
>   	static fwts_acpidump_field asf_addr_fields[] = {
>

Acked-by: Ivan Hu <ivan.hu@canonical.com>
Alex Hung - June 10, 2013, 7:39 a.m.
On 06/06/2013 10:18 PM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> We're missing a NULL terminator to asf_header_fields which causes
> ASF! headers to cause a segfault.
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>   src/acpi/acpidump/acpidump.c | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/src/acpi/acpidump/acpidump.c b/src/acpi/acpidump/acpidump.c
> index d95c166..51132f5 100644
> --- a/src/acpi/acpidump/acpidump.c
> +++ b/src/acpi/acpidump/acpidump.c
> @@ -1189,6 +1189,7 @@ static void acpidump_asf(fwts_framework *fw, fwts_acpi_table_info *table)
>   		FIELD_UINT("Type", fwts_acpi_table_asf_header, type),
>   		FIELD_UINT("Reserved", fwts_acpi_table_asf_header, reserved),
>   		FIELD_UINT("Length", fwts_acpi_table_asf_header, length),
> +		FIELD_END
>   	};
>
>   	static fwts_acpidump_field asf_addr_fields[] = {
>
Acked-by: Alex Hung <alex.hung@canonical.com>

Patch

diff --git a/src/acpi/acpidump/acpidump.c b/src/acpi/acpidump/acpidump.c
index d95c166..51132f5 100644
--- a/src/acpi/acpidump/acpidump.c
+++ b/src/acpi/acpidump/acpidump.c
@@ -1189,6 +1189,7 @@  static void acpidump_asf(fwts_framework *fw, fwts_acpi_table_info *table)
 		FIELD_UINT("Type", fwts_acpi_table_asf_header, type),
 		FIELD_UINT("Reserved", fwts_acpi_table_asf_header, reserved),
 		FIELD_UINT("Length", fwts_acpi_table_asf_header, length),
+		FIELD_END
 	};
 
 	static fwts_acpidump_field asf_addr_fields[] = {