Skip to contentSkip to conversation

lsusb: Fix array entry count for variable sized entries.

PATCH New Greg KH 1 participant 1 message Dec 8, 2017 USB

lore
Share & tools
lore

Greg KH

author
#0 lore raw

PATCH 1/1 lsusb: Fix array entry count for variable sized entries.

Quoted 18 lines · Michael Drake
Quoted 10 lines · Greg KH
Quoted 9 lines · Michael Drake

This fixes a divide by zero which happened when an array, without an explicit entry count (ultimately calculated from the value in the descriptor data's bLength field) was used on field with a variable size.

The solultion is to use the get_entry_size() function on the array entry, which can get the entry size from a referenced field.

Quoted 6 lines
Quoted 4 lines
---
  desc-dump.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

Nice, that fixed the problem, thanks.

Quoted 7 lines

Great, thanks Greg!

Quoted 1 line

Now applied and pushed out.

I can't see this commit yet on

https://github.com/gregkh/usbutils/commits/master

Oops, forgot to sync my laptop, it's there now.

greg k-h
---
To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html