From b371a4f53176478cc6d1bc655bf53d436b1bc11f Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Fri, 28 Aug 2015 13:45:49 +0300 Subject: [PATCH] audio/avrcp: Fix sending wrong player id and uid counter memset only takes the first byte so it obviously cannot be used as memcpy. --- profiles/audio/avrcp.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/profiles/audio/avrcp.c b/profiles/audio/avrcp.c index fd3504c77..d2b006539 100644 --- a/profiles/audio/avrcp.c +++ b/profiles/audio/avrcp.c @@ -1536,10 +1536,8 @@ static uint8_t avrcp_handle_register_notification(struct avrcp *session, break; case AVRCP_EVENT_ADDRESSED_PLAYER_CHANGED: len = 5; - memset(&pdu->params[1], player_get_id(player), - sizeof(uint16_t)); - memset(&pdu->params[3], player_get_uid_counter(player), - sizeof(uint16_t)); + bt_put_be16(player_get_id(player), &pdu->params[1]); + bt_put_be16(player_get_uid_counter(player), &pdu->params[3]); break; case AVRCP_EVENT_AVAILABLE_PLAYERS_CHANGED: len = 1; -- 2.47.3