fix off-by-one
This change strengthens a bounds check to make sure no out of bound indexing occurs when using a port.
This commit is contained in:
parent
37230bf0c3
commit
6d152649a3
|
|
@ -417,7 +417,7 @@ hub_task(void * UNUSED(arg))
|
|||
HUB_DEBUG_MSG("bHubContrCurrent %4X", d->bHubContrCurrent);
|
||||
|
||||
/* Check for sane number of ports... */
|
||||
if (d->bNbrPorts > USB_HUB_PORT_LIMIT) {
|
||||
if (d->bNbrPorts >= USB_HUB_PORT_LIMIT) {
|
||||
HUB_MSG("Too many hub ports declared: %d", d->bNbrPorts);
|
||||
goto HUB_ERROR;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user