mirror of
https://github.com/apache/nuttx.git
synced 2026-08-02 20:59:02 +00:00
An off-by-one error caused invalid memory to be accessed when the last port was used. The first entry, at index 0, was never used. The USB standard uses 1-based numbering for hub ports. This number was used to index an array. This change converts the port number to a zero-based port index when the array is accessed. The zero-based value in the port field of the usbhost_hubport_s structure is also converted before printing. For testing, this bug was exposed on a 4 port hub when port 4 was used after changing USBHUB_MAX_PORTS to 4 in hub.h. The bug should also be triggered without changing hub.h if a 7 port hub is available. |
||
|---|---|---|
| .. | ||
| hid_parser.c | ||
| Kconfig | ||
| Make.defs | ||
| usbhost_cdcacm.c | ||
| usbhost_cdcmbim.c | ||
| usbhost_composite.c | ||
| usbhost_composite.h | ||
| usbhost_devaddr.c | ||
| usbhost_enumerate.c | ||
| usbhost_findclass.c | ||
| usbhost_ft232r.c | ||
| usbhost_hidkbd.c | ||
| usbhost_hidmouse.c | ||
| usbhost_hub.c | ||
| usbhost_max3421e.c | ||
| usbhost_registerclass.c | ||
| usbhost_registry.c | ||
| usbhost_registry.h | ||
| usbhost_skeleton.c | ||
| usbhost_storage.c | ||
| usbhost_trace.c | ||
| usbhost_xboxcontroller.c | ||