Skip to contentSkip to conversation

avinfo: Fix parsing capabilities

PATCH Applied Pali Rohár 2 participants 2 messages Jan 26, 2019 – Jan 31, 2019 Bluetooth drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 avinfo: Fix parsing capabilities

Function print_caps() expects capabilities buffer without AVDTP header. Previously avinfo somehow worked, because AVDTP header looks like capability header with unknown category which was skipped.

---
 tools/avinfo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/avinfo.c +1 -1
index 02fc1f233..a3298e8c8 100644
@@ -809,7 +809,7 @@ static ssize_t avdtp_get_caps(int sk, int seid)
 		return -1;
 	}
 
-	print_caps(caps, ret);
+	print_caps(caps->caps, ret - sizeof(struct getcap_resp));
 
 	return 0;
 }
Signature · 1 line
2.11.0
maintainer Applied
#1 lore raw

Hi Pali,

Quoted 22 lines · Pali Rohár

Function print_caps() expects capabilities buffer without AVDTP header. Previously avinfo somehow worked, because AVDTP header looks like capability header with unknown category which was skipped.

---
 tools/avinfo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/avinfo.c +1 -2
index 02fc1f233..a3298e8c8 100644
@@ -809,7 +809,7 @@ static ssize_t avdtp_get_caps(int sk, int seid)
                return -1;
        }
 
-       print_caps(caps, ret);
+       print_caps(caps->caps, ret - sizeof(struct getcap_resp));
 
        return 0;
 }
--
Quoted 1 line

2.11.0

Applied, thanks.

Signature · 1 line
Luiz Augusto von Dentz