Skip to content

Commit a2d6ead

Browse files
committed
Fix hang on GIGABYTE keyboard
0 length items in the configuration descriptor.
1 parent 26a1906 commit a2d6ead

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/USBHost/USBHost.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1017,6 +1017,10 @@ void USBHost::parseConfDescr(USBDeviceConnected * dev, uint8_t * conf_descr, uin
10171017

10181018
while (index < len) {
10191019
len_desc = conf_descr[index];
1020+
if (len_desc == 0) {
1021+
index++;
1022+
continue;
1023+
}
10201024
id = conf_descr[index+1];
10211025
switch (id) {
10221026
case CONFIGURATION_DESCRIPTOR:

0 commit comments

Comments
 (0)