public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH BlueZ v1 1/1] Fix null pointer deference in bap_get_ascs()
@ 2024-04-23  7:44 Sarveshwar Bajaj
  2024-04-23  7:44 ` [PATCH BlueZ v1 0/1] " Sarveshwar Bajaj
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Sarveshwar Bajaj @ 2024-04-23  7:44 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: vinit.mehta, devyani.godbole, mahesh.talewad

Ensure that bap and rdb pointers are valid before accessing or
allocating memory for ascs. Added  null check to prevent potential
crash
---
 src/shared/bap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/shared/bap.c b/src/shared/bap.c
index 71eadbdb6..0db9ba285 100644
--- a/src/shared/bap.c
+++ b/src/shared/bap.c
@@ -1405,7 +1405,7 @@ static bool match_req(const void *data, const void *match_data)
 
 static struct bt_ascs *bap_get_ascs(struct bt_bap *bap)
 {
-	if (!bap)
+	if (!bap || !bap->rdb)
 		return NULL;
 
 	if (bap->rdb->ascs)
-- 
2.21.0.windows.1


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

end of thread, other threads:[~2024-04-29 14:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-23  7:44 [PATCH BlueZ v1 1/1] Fix null pointer deference in bap_get_ascs() Sarveshwar Bajaj
2024-04-23  7:44 ` [PATCH BlueZ v1 0/1] " Sarveshwar Bajaj
2024-04-23  9:40 ` [BlueZ,v1,1/1] " bluez.test.bot
2024-04-29 14:50 ` [PATCH BlueZ v1 1/1] " patchwork-bot+bluetooth

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