From d2a2aabee646c4e95655bc5dc93c323efa5fc588 Mon Sep 17 00:00:00 2001 From: Sarveshwar Bajaj Date: Tue, 23 Apr 2024 13:14:25 +0530 Subject: [PATCH] Fix null pointer deference in bap_get_ascs() 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 36f0b0a3b..818326f45 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.47.3