Thread (3 messages) flat view 3 messages, 1 author, 2014-02-28
STALE4576d

[PATCH] avrcp: Fix buffer size

From: Andrei Emeltchenko <hidden>
Date: 2014-02-28 10:44:12
Subsystem: the rest · Maintainer: Linus Torvalds

From: Andrei Emeltchenko <redacted>

For avrcp_get_current_player_value() buffer size needs to be
AVRCP_ATTRIBUTE_LAST + 1 for all attributes + 1 for number of attributes
written first, not counting header.
---
 profiles/audio/avrcp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/profiles/audio/avrcp.c b/profiles/audio/avrcp.c
index c0e5d07..8098c62 100644
--- a/profiles/audio/avrcp.c
+++ b/profiles/audio/avrcp.c
@@ -1905,7 +1905,7 @@ static gboolean avrcp_player_value_rsp(struct avctp *conn,
 static void avrcp_get_current_player_value(struct avrcp *session,
 						uint8_t *attrs, uint8_t count)
 {
-	uint8_t buf[AVRCP_HEADER_LENGTH + AVRCP_ATTRIBUTE_LAST + 1];
+	uint8_t buf[AVRCP_HEADER_LENGTH + AVRCP_ATTRIBUTE_LAST + 2];
 	struct avrcp_header *pdu = (void *) buf;
 	uint16_t length = AVRCP_HEADER_LENGTH + count + 1;
 
-- 
1.8.3.2
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help