[PATCH BlueZ] media: fix wrong argument to lp_get_uid() in avrcp-player

Pauli Virtanen <[email protected]>
Newsgroups org.kernel.vger.linux-bluetooth
Message-ID <f2c2db83dbe2a47623828db3e5f4baf476336d9e.1786827817.git.pav@iki.fi>
In track_changed(), lp_get_uid() is passed struct local_player although
player_link is expected, which is ASAN crash.  It takes void * since
it's avrcp_player_cb callback function, so wasn't caught by compiler.

Pass the right object. Fixes AddressSanitizer: heap-buffer-overflow
---
 profiles/audio/avrcp-player.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/profiles/audio/avrcp-player.c b/profiles/audio/avrcp-player.c
index d335e7ef6..43db0dc45 100644
--- a/profiles/audio/avrcp-player.c
+++ b/profiles/audio/avrcp-player.c
@@ -198,7 +198,7 @@ static void track_position(uint32_t old, uint32_t position, void *user_data)
 static void track_changed(void *user_data)
 {
 	struct player_link *p = user_data;
-	uint64_t uid = lp_get_uid(p->lp);
+	uint64_t uid = lp_get_uid(p);
 
 	avrcp_player_event(p->avrcp, AVRCP_EVENT_TRACK_CHANGED, &uid);
 	avrcp_player_event(p->avrcp, AVRCP_EVENT_TRACK_REACHED_START, NULL);
-- 
2.55.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.