Procházet zdrojové kódy

[xhci] Avoid accessing beyond end of endpoint context array

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown před 7 roky
rodič
revize
6124c0ebfa
1 změnil soubory, kde provedl 1 přidání a 1 odebrání
  1. 1
    1
      src/drivers/usb/xhci.c

+ 1
- 1
src/drivers/usb/xhci.c Zobrazit soubor

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

Načítá se…
Zrušit
Uložit