Skip to content

Commit d660d38

Browse files
sjancjhedberg
authored andcommitted
Bluetooth: MPL: Fix NULL pointer dereference in on_obj_selected
Track may not have next track and thus this must be checked before trying to match ID. This was affecting following qualification test cases: GMCS/SR/MCP/BV-38-C GMCS/SR/MCP/BV-39-C GMCS/SR/MCP/BV-40-C Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
1 parent 85830bf commit d660d38

File tree

1 file changed

+2
-1
lines changed
  • subsys/bluetooth/audio

1 file changed

+2
-1
lines changed

subsys/bluetooth/audio/mpl.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -722,7 +722,8 @@ static void on_obj_selected(struct bt_ots *ots, struct bt_conn *conn,
722722
/* Next track, if the next track has been explicitly set */
723723
LOG_DBG("Next Track Object ID");
724724
(void)setup_track_object(media_player.next.track);
725-
} else if (id == media_player.group->track->next->id) {
725+
} else if (media_player.group->track->next != NULL &&
726+
id == media_player.group->track->next->id) {
726727
/* Next track, if next track has not been explicitly set */
727728
LOG_DBG("Next Track Object ID");
728729
(void)setup_track_object(media_player.group->track->next);

0 commit comments

Comments
 (0)