[PATCH] acpi: method: check for NULL buf before dereferencing it (LP: #1205267)

Colin King colin.king at canonical.com
Fri Jul 26 09:54:27 UTC 2013


From: Colin Ian King <colin.king at canonical.com>

There may be a possibility that buf is NULL, so check for this
before dereferencing it.

Signed-off-by: Colin Ian King <colin.king at canonical.com>
---
 src/acpi/method/method.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/acpi/method/method.c b/src/acpi/method/method.c
index 628ead6..f46fdff 100644
--- a/src/acpi/method/method.c
+++ b/src/acpi/method/method.c
@@ -681,7 +681,7 @@ static void method_test_NULL_return(
 		}
 	}
 
-	if (buf->Length && buf->Pointer) {
+	if (buf && buf->Length && buf->Pointer) {
 		fwts_failed(fw, LOG_LEVEL_MEDIUM, "MethodShouldReturnNothing", "%s returned values, but was expected to return nothing.", name);
 		fwts_tag_failed(fw, FWTS_TAG_ACPI_METHOD_RETURN);
 		fwts_log_info(fw, "Object returned:");
-- 
1.8.1.2




More information about the fwts-devel mailing list