2014-01-03 10:18:53

by Andrei Emeltchenko

[permalink] [raw]
Subject: [PATCH] android/tester: Fix NULL dereference.

From: Andrei Emeltchenko <[email protected]>

NULL pointer data->if_bluetooth will be dereferenced without return.
---
android/android-tester.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/android/android-tester.c b/android/android-tester.c
index 04fa811..e34d1bd 100644
--- a/android/android-tester.c
+++ b/android/android-tester.c
@@ -1052,7 +1052,9 @@ static void setup_enabled_adapter(const void *test_data)
if (status != BT_STATUS_SUCCESS) {
data->if_bluetooth = NULL;
tester_setup_failed();
+ return;
}
+
status = data->if_bluetooth->enable();
if (status != BT_STATUS_SUCCESS)
tester_setup_failed();
--
1.8.3.2



2014-01-03 13:48:08

by Johan Hedberg

[permalink] [raw]
Subject: Re: [PATCH] android/tester: Fix NULL dereference.

Hi Andrei,

On Fri, Jan 03, 2014, Andrei Emeltchenko wrote:
> NULL pointer data->if_bluetooth will be dereferenced without return.
> ---
> android/android-tester.c | 2 ++
> 1 file changed, 2 insertions(+)

Applied. Thanks.

Johan