ldube opened a new pull request, #9257:
URL: https://github.com/apache/nuttx/pull/9257

   ## Summary
   
   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.
   
   ## Impact
   
   ## Testing
   
   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.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to