2014-01-03 10:26:14

by Andrei Emeltchenko

[permalink] [raw]
Subject: [PATCH] android/tester: Fix NULL dereference in socket setup

From: Andrei Emeltchenko <[email protected]>

Add return statement to avoid NULL dereference in socket setup.
---
android/android-tester.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/android/android-tester.c b/android/android-tester.c
index e34d1bd..9a161ad 100644
--- a/android/android-tester.c
+++ b/android/android-tester.c
@@ -1567,6 +1567,7 @@ static void setup_socket_interface(const void *test_data)
if (status != BT_STATUS_SUCCESS) {
data->if_bluetooth = NULL;
tester_setup_failed();
+ return;
}

sock = data->if_bluetooth->get_profile_interface(BT_PROFILE_SOCKETS_ID);
@@ -1592,6 +1593,7 @@ static void setup_socket_interface_enabled(const void *test_data)
if (status != BT_STATUS_SUCCESS) {
data->if_bluetooth = NULL;
tester_setup_failed();
+ return;
}

sock = data->if_bluetooth->get_profile_interface(BT_PROFILE_SOCKETS_ID);
--
1.8.3.2



2014-01-03 13:48:22

by Johan Hedberg

[permalink] [raw]
Subject: Re: [PATCH] android/tester: Fix NULL dereference in socket setup

Hi Andrei,

On Fri, Jan 03, 2014, Andrei Emeltchenko wrote:
> Add return statement to avoid NULL dereference in socket setup.
> ---
> android/android-tester.c | 2 ++
> 1 file changed, 2 insertions(+)

Applied. Thanks.

Johan