Skip to content

Commit 7a886dd

Browse files
authored
Merge pull request #41 from KurtE/config_desc_0len_field
Fix hang on GIGABYTE keyboard
2 parents 5b2eeb4 + a2d6ead commit 7a886dd

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)