[BlueZ, v3 3/9] unit: Add test for sdp-xml type-confusion bug

Bastien Nocera <[email protected]>
Newsgroups org.kernel.vger.linux-bluetooth
Message-ID <[email protected]>
See https://github.com/bluez/bluez/security/advisories/GHSA-7mmr-gwqx-vc34

Co-authored-by: Aisle Research
---
 unit/sdp-xml/compute-seq-size-type-confusion.xml | 9 +++++++++
 unit/test-sdp-xml.c                              | 2 ++
 2 files changed, 11 insertions(+)
 create mode 100644 unit/sdp-xml/compute-seq-size-type-confusion.xml

diff --git a/unit/sdp-xml/compute-seq-size-type-confusion.xml b/unit/sdp-xml/compute-seq-size-type-confusion.xml
new file mode 100644
index 000000000000..41d6478af276
--- /dev/null
+++ b/unit/sdp-xml/compute-seq-size-type-confusion.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<record>
+<attribute id="0x0001">
+<sequence>
+<attribute id="0x0002"><uint8 value="0x01"/></attribute>
+<uint64 value="0x4141414141414141"/>
+</sequence>
+</attribute>
+</record>
diff --git a/unit/test-sdp-xml.c b/unit/test-sdp-xml.c
index 11a83951678d..1e3123892f95 100644
--- a/unit/test-sdp-xml.c
+++ b/unit/test-sdp-xml.c
@@ -77,6 +77,8 @@ int main(int argc, char *argv[])
 
 	DEFINE_TEST("Bluetooth_HID-sdp_record.xml", TRUE);
 	DEFINE_TEST("qt-SerialPortSDPRecord.xml", TRUE);
+	/* From https://github.com/bluez/bluez/security/advisories/GHSA-7mmr-gwqx-vc34 */
+	DEFINE_TEST("compute-seq-size-type-confusion.xml", FALSE);
 
 	return tester_run();
 }
-- 
2.55.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.