[xhci] Avoid accessing beyond end of endpoint context array

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2017-03-21 16:22:42 +02:00
parent 501fa53b25
commit 6124c0ebfa

View File

@@ -1558,7 +1558,7 @@ static void xhci_transfer ( struct xhci_device *xhci,
}
/* Identify endpoint */
if ( ( trb->endpoint > XHCI_CTX_END ) ||
if ( ( trb->endpoint >= XHCI_CTX_END ) ||
( ( endpoint = slot->endpoint[trb->endpoint] ) == NULL ) ) {
DBGC ( xhci, "XHCI %s slot %d transfer event invalid epid "
"%d:\n", xhci->name, slot->id, trb->endpoint );