diff --git a/src/classic/avrcp_target.c b/src/classic/avrcp_target.c index 80e74840e..3f3a87fdf 100644 --- a/src/classic/avrcp_target.c +++ b/src/classic/avrcp_target.c @@ -1260,8 +1260,13 @@ static void avrcp_handle_l2cap_data_packet_for_signaling_connection(avrcp_connec } uint8_t play_identifier[8]; - memcpy(play_identifier, &packet[pos], 8); + memset(play_identifier, 0, 8); + if (memcmp(&packet[pos], play_identifier, 8) != 0) { + avrcp_target_response_vendor_dependent_reject(connection, pdu_id, AVRCP_STATUS_INVALID_PARAMETER); + return; + } pos += 8; + uint8_t attribute_count = packet[pos++]; connection->next_attr_id = AVRCP_MEDIA_ATTR_NONE; if (!attribute_count){