usb: Fix device_qualifier descriptor length

The descriptor was missing the bReserved field, which must be zero.
This resulted in an out-of-bounds array copy when transmitting the
device_qualifier descriptor, and possible transmission of garbage
for the bReserved field.

This is based on PR #5 created by kimstik@github
This commit is contained in:
Keir Fraser
2023-10-03 18:41:36 +01:00
parent b41091017c
commit 191d68f41b

View File

@@ -28,7 +28,8 @@ const uint8_t device_qualifier[] aligned(2) = {
0x00,0x02, /* USB 2.0 */
2, 0, 0, /* Class, Subclass, Protocol: CDC */
64, /* Max Packet Size */
1 /* Number of configurations */
1, /* Number of configurations */
0 /* bReserved - must be zero */
};
const uint8_t config_fs_descriptor[] aligned(2) = {