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