Thread (2 messages) flat view 2 messages, 2 authors, 2021-06-08
STALE1932d REVIEWED: 1 (0M)

1 review trailer.

[BlueZ PATCH v1] avrcp: fix byte order of PDU parameter length compare

From: Michael Sun <hidden>
Date: 2021-06-08 17:41:20
Subsystem: the rest · Maintainer: Linus Torvalds

Fix the issue that directly uses params_len, from received PDU data,
for arithmetic calculation and comparison.

Reviewed-by: Alain Michaud <redacted>
Signed-off-by: Michael Sun <redacted>
---

 profiles/audio/avrcp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/profiles/audio/avrcp.c b/profiles/audio/avrcp.c
index ccf34b220..2265f87ab 100644
--- a/profiles/audio/avrcp.c
+++ b/profiles/audio/avrcp.c
@@ -1923,9 +1923,9 @@ static size_t handle_vendordep_pdu(struct avctp *conn, uint8_t transaction,
 	operands += sizeof(*pdu);
 	operand_count -= sizeof(*pdu);
 
-	if (pdu->params_len != operand_count) {
+	if (pdu->params_len != htons(operand_count)) {
 		DBG("AVRCP PDU parameters length don't match");
-		pdu->params_len = operand_count;
+		pdu->params_len = htons(operand_count);
 	}
 
 	for (handler = session->control_handlers; handler->pdu_id; handler++) {
-- 
2.32.0.rc1.229.g3e70b5a671-goog
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help