From 8891babcf41962c11fc19bc240ddbb89cc6e6c99 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Thu, 2 Sep 2021 17:01:24 -0700 Subject: [PATCH] monitor: Fix calculation of RFCOMM length Byte order is assumed to be big endian instead of little endian. --- monitor/rfcomm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/monitor/rfcomm.c b/monitor/rfcomm.c index 3eb19faf0..41533b158 100644 --- a/monitor/rfcomm.c +++ b/monitor/rfcomm.c @@ -448,7 +448,7 @@ void rfcomm_packet(const struct l2cap_frame *frame) else { if (!l2cap_frame_get_u8(l2cap_frame, &ex_length)) goto fail; - hdr.length = ((uint16_t)length << 8) | ex_length; + hdr.length = ((uint16_t)ex_length << 8) | length; hdr.length = GET_LEN16(hdr.length); } -- 2.47.3