Skip to content

Commit

Permalink
Bluetooth: A2DP: Check the pointer before using
Browse files Browse the repository at this point in the history
Check the pointer `sep` before using it.

Fixes #74734.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
  • Loading branch information
lylezhu2012 authored and aescolar committed Jul 5, 2024
1 parent 8276d4f commit c9708ff
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions subsys/bluetooth/host/classic/a2dp.c
Original file line number Diff line number Diff line change
Expand Up @@ -195,11 +195,10 @@ static int a2dp_set_config_ind(struct bt_avdtp *session, struct bt_avdtp_sep *se
int err;

*errcode = 0;

__ASSERT(sep, "Invalid sep");

ep = CONTAINER_OF(sep, struct bt_a2dp_ep, sep);
if (ep == NULL) {
*errcode = BT_AVDTP_BAD_ACP_SEID;
return -1;
}

/* parse the configuration */
codec_info_element_len = 4U;
Expand Down

0 comments on commit c9708ff

Please sign in to comment.