diff mbox series

dsddump: fix segfault on type ACPI_TYPE_LOCAL_REFERENCE

Message ID 20190701140118.25282-1-ernunes@redhat.com
State Accepted
Headers show
Series dsddump: fix segfault on type ACPI_TYPE_LOCAL_REFERENCE | expand

Commit Message

Erico Nunes July 1, 2019, 2:01 p.m. UTC
The ACPI_BUFFER on dsddump print_package_element was unitialized and
caused a segfault running on platforms with a _DSD containing
ACPI_TYPE_LOCAL_REFERENCE.

Signed-off-by: Erico Nunes <ernunes@redhat.com>
---
 src/acpi/dsddump/dsddump.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Colin Ian King July 1, 2019, 2:05 p.m. UTC | #1
On 01/07/2019 15:01, Erico Nunes wrote:
> The ACPI_BUFFER on dsddump print_package_element was unitialized and
> caused a segfault running on platforms with a _DSD containing
> ACPI_TYPE_LOCAL_REFERENCE.
> 
> Signed-off-by: Erico Nunes <ernunes@redhat.com>
> ---
>  src/acpi/dsddump/dsddump.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/src/acpi/dsddump/dsddump.c b/src/acpi/dsddump/dsddump.c
> index c4e0610b..c60ba20e 100644
> --- a/src/acpi/dsddump/dsddump.c
> +++ b/src/acpi/dsddump/dsddump.c
> @@ -55,6 +55,9 @@ static void print_package_element(fwts_framework *fw, ACPI_OBJECT *obj)
>  	ACPI_STATUS status;
>  	ACPI_BUFFER buffer;
>  
> +	buffer.Length = sizeof(full_name);
> +	buffer.Pointer = full_name;
> +
>  	switch (obj->Type) {
>  		case ACPI_TYPE_INTEGER:
>  			fwts_log_info_verbatim(fw, "    Value: 0x%8.8" PRIx64, obj->Integer.Value);
> 

Thanks for the fix.

Acked-by: Colin Ian King <colin.king@canonical.com>
Alex Hung July 2, 2019, 12:25 a.m. UTC | #2
On 2019-07-01 7:01 a.m., Erico Nunes wrote:
> The ACPI_BUFFER on dsddump print_package_element was unitialized and
> caused a segfault running on platforms with a _DSD containing
> ACPI_TYPE_LOCAL_REFERENCE.
> 
> Signed-off-by: Erico Nunes <ernunes@redhat.com>
> ---
>  src/acpi/dsddump/dsddump.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/src/acpi/dsddump/dsddump.c b/src/acpi/dsddump/dsddump.c
> index c4e0610b..c60ba20e 100644
> --- a/src/acpi/dsddump/dsddump.c
> +++ b/src/acpi/dsddump/dsddump.c
> @@ -55,6 +55,9 @@ static void print_package_element(fwts_framework *fw, ACPI_OBJECT *obj)
>  	ACPI_STATUS status;
>  	ACPI_BUFFER buffer;
>  
> +	buffer.Length = sizeof(full_name);
> +	buffer.Pointer = full_name;
> +
>  	switch (obj->Type) {
>  		case ACPI_TYPE_INTEGER:
>  			fwts_log_info_verbatim(fw, "    Value: 0x%8.8" PRIx64, obj->Integer.Value);
> 


Acked-by: Alex Hung <alex.hung@canonical.com>
diff mbox series

Patch

diff --git a/src/acpi/dsddump/dsddump.c b/src/acpi/dsddump/dsddump.c
index c4e0610b..c60ba20e 100644
--- a/src/acpi/dsddump/dsddump.c
+++ b/src/acpi/dsddump/dsddump.c
@@ -55,6 +55,9 @@  static void print_package_element(fwts_framework *fw, ACPI_OBJECT *obj)
 	ACPI_STATUS status;
 	ACPI_BUFFER buffer;
 
+	buffer.Length = sizeof(full_name);
+	buffer.Pointer = full_name;
+
 	switch (obj->Type) {
 		case ACPI_TYPE_INTEGER:
 			fwts_log_info_verbatim(fw, "    Value: 0x%8.8" PRIx64, obj->Integer.Value);