Skip to content

Commit e6da768

Browse files
Thalleykartben
authored andcommitted
Bluetooth: BAP: Add missing ep->iso checks
The bt_bap_unicast_client_ep_qos function attempts to access ep->iso->chan.iso->iso, but where some of the pointers may be invalid. Add an additional check for these. Signed-off-by: Emil Gydesen <[email protected]>
1 parent 6dffbf8 commit e6da768

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

subsys/bluetooth/audio/bap_unicast_client.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1957,7 +1957,9 @@ int bt_bap_unicast_client_ep_qos(struct bt_bap_ep *ep, struct net_buf_simple *bu
19571957

19581958
LOG_DBG("ep %p buf %p qos %p", ep, buf, qos);
19591959

1960-
if (!ep) {
1960+
if (ep == NULL || ep->iso == NULL || ep->iso->chan.iso == NULL) {
1961+
LOG_DBG("Invalid endpoint %p (%p (%p))", ep, ep == NULL ? NULL : ep->iso,
1962+
(ep == NULL || ep->iso == NULL) ? NULL : ep->iso->chan.iso);
19611963
return -EINVAL;
19621964
}
19631965

0 commit comments

Comments
 (0)