From 8ebb3c79e11dd7ce7000622a16f03bbb0bdaf638 Mon Sep 17 00:00:00 2001 From: Lucas De Marchi Date: Wed, 28 Sep 2011 19:35:57 -0300 Subject: [PATCH] AVRCP: fix case when only one setting is provided If CT tries to change an Application Setting providing only one setting, the size of the PDU will be 3 bytes. Therefore we should check if the PDU is shorter than or equal 3, not only shorter. --- audio/avrcp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/audio/avrcp.c b/audio/avrcp.c index e7b0d1bc9..ac9a1076a 100644 --- a/audio/avrcp.c +++ b/audio/avrcp.c @@ -1021,7 +1021,7 @@ static uint8_t avrcp_handle_set_player_value(struct media_player *mp, uint16_t len = ntohs(pdu->params_len); unsigned int i; - if (len < 3) + if (len <= 3) goto err; len = 0; -- 2.47.3