Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH 1/7] android/handsfree: Check service class is not zero
@ 2014-04-17 12:23 Andrei Emeltchenko
  2014-04-17 12:23 ` [PATCH 2/7] android/hal-audio-hsp: Add audio HAL for HSP handling Andrei Emeltchenko
                   ` (6 more replies)
  0 siblings, 7 replies; 17+ messages in thread
From: Andrei Emeltchenko @ 2014-04-17 12:23 UTC (permalink / raw)
  To: linux-bluetooth

From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>

Fixes static analyzers NULL dereference warnings. The similar check is
done in src/device.c in line 2959.
---
 android/handsfree.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/android/handsfree.c b/android/handsfree.c
index 02b6dad..c8026a0 100644
--- a/android/handsfree.c
+++ b/android/handsfree.c
@@ -1405,6 +1405,9 @@ static void sdp_hsp_search_cb(sdp_list_t *recs, int err, gpointer data)
 		goto fail;
 	}
 
+	if (!classes)
+		goto fail;
+
 	if (sdp_get_access_protos(recs->data, &protos) < 0) {
 		error("handsfree: unable to get access protocols from record");
 		sdp_list_free(classes, free);
@@ -1495,6 +1498,9 @@ static void sdp_hfp_search_cb(sdp_list_t *recs, int err, gpointer data)
 		goto fail;
 	}
 
+	if (!classes)
+		goto fail;
+
 	if (sdp_get_access_protos(recs->data, &protos) < 0) {
 		error("handsfree: unable to get access protocols from record");
 		sdp_list_free(classes, free);
-- 
1.8.3.2


^ permalink raw reply related	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2014-04-23 18:59 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-17 12:23 [PATCH 1/7] android/handsfree: Check service class is not zero Andrei Emeltchenko
2014-04-17 12:23 ` [PATCH 2/7] android/hal-audio-hsp: Add audio HAL for HSP handling Andrei Emeltchenko
2014-04-17 13:00   ` Szymon Janc
2014-04-17 12:23 ` [PATCH 3/7] android/hal-audio: Make code readable Andrei Emeltchenko
2014-04-17 13:02   ` Szymon Janc
2014-04-17 12:23 ` [PATCH 4/7] android/hal-audio-hsp: Add open_output_stream() Andrei Emeltchenko
2014-04-17 12:23 ` [PATCH 5/7] android/hal-audio: Add SCO audio API Andrei Emeltchenko
2014-04-17 13:20   ` Szymon Janc
2014-04-22 15:36     ` Luiz Augusto von Dentz
2014-04-23 14:06   ` Jesse Koegler
2014-04-23 18:41     ` Luiz Augusto von Dentz
2014-04-23 18:59       ` Jesse Koegler
2014-04-17 12:23 ` [PATCH 6/7] android/ipc: Use error printing error messages Andrei Emeltchenko
2014-04-17 13:23   ` Szymon Janc
2014-04-17 12:23 ` [PATCH 7/7] android/handsfree: trivial: Correct comment style Andrei Emeltchenko
2014-04-17 13:26   ` Szymon Janc
2014-04-17 12:54 ` [PATCH 1/7] android/handsfree: Check service class is not zero Szymon Janc

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox