Message ID | 1374832467-6504-1-git-send-email-colin.king@canonical.com |
---|---|
State | Accepted |
Headers | show |
On 07/26/2013 05:54 PM, Colin King wrote: > From: Colin Ian King <colin.king@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@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:"); > Acked-by: Alex Hung <alex.hung@canonical.com>
On 07/26/2013 05:54 PM, Colin King wrote: > From: Colin Ian King <colin.king@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@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:"); > Acked-by: Ivan Hu <ivan.hu@canonical.com>
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:");