unit/avrcp: Fix possible buffer overflow

values[] should be the same size as attr[].
This commit is contained in:
Andrei Emeltchenko 2014-03-18 15:31:19 +02:00 committed by Luiz Augusto von Dentz
parent 9bf4b1c73a
commit c62dfb9b8d

View File

@ -354,10 +354,12 @@ static int get_value_text(struct avrcp *session, uint8_t transaction,
static int get_value(struct avrcp *session, uint8_t transaction,
uint8_t number, uint8_t *attrs, void *user_data)
{
uint8_t values[2] = { 0x00, 0x00 };
uint8_t values[number];
DBG("");
memset(values, 0, number);
avrcp_get_current_player_value_rsp(session, transaction, number, attrs,
values);