All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH BlueZ v2] avdtp: add NULL checks to avdtp_has_stream()
@ 2024-06-29  8:36 Roman Smirnov
  2024-06-29 10:39 ` [BlueZ,v2] " bluez.test.bot
  2024-07-01 14:20 ` [PATCH BlueZ v2] " patchwork-bot+bluetooth
  0 siblings, 2 replies; 3+ messages in thread
From: Roman Smirnov @ 2024-06-29  8:36 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Roman Smirnov

Make avdtp_has_stream() safe for passing NULL pointers.

Found with the SVACE static analysis tool.
---
 V1 -> V2: added check for stream

 profiles/audio/avdtp.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/profiles/audio/avdtp.c b/profiles/audio/avdtp.c
index 3667e0840..64735c5ee 100644
--- a/profiles/audio/avdtp.c
+++ b/profiles/audio/avdtp.c
@@ -3918,6 +3918,9 @@ struct btd_device *avdtp_get_device(struct avdtp *session)
 
 gboolean avdtp_has_stream(struct avdtp *session, struct avdtp_stream *stream)
 {
+	if (!session || !stream)
+		return FALSE;
+
 	return g_slist_find(session->streams, stream) ? TRUE : FALSE;
 }
 
-- 
2.43.0


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

end of thread, other threads:[~2024-07-01 14:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-29  8:36 [PATCH BlueZ v2] avdtp: add NULL checks to avdtp_has_stream() Roman Smirnov
2024-06-29 10:39 ` [BlueZ,v2] " bluez.test.bot
2024-07-01 14:20 ` [PATCH BlueZ v2] " patchwork-bot+bluetooth

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.