mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
If the ID byte is non zero then we allow descriptors having multiple sizes.
Submitted by: HPS Reported by: daichi
This commit is contained in:
parent
b486f60642
commit
0ca80d71d0
1 changed files with 12 additions and 3 deletions
|
|
@ -173,12 +173,21 @@ uhid_intr_callback(struct usb_xfer *xfer, usb_error_t error)
|
|||
DPRINTF("transferred!\n");
|
||||
|
||||
pc = usbd_xfer_get_frame(xfer, 0);
|
||||
if (actlen >= sc->sc_isize) {
|
||||
|
||||
/*
|
||||
* If the ID byte is non zero we allow descriptors
|
||||
* having multiple sizes:
|
||||
*/
|
||||
if ((actlen >= sc->sc_isize) ||
|
||||
((actlen > 0) && (sc->sc_iid != 0))) {
|
||||
/* limit report length to the maximum */
|
||||
if (actlen > sc->sc_isize)
|
||||
actlen = sc->sc_isize;
|
||||
usb_fifo_put_data(sc->sc_fifo.fp[USB_FIFO_RX], pc,
|
||||
0, sc->sc_isize, 1);
|
||||
0, actlen, 1);
|
||||
} else {
|
||||
/* ignore it */
|
||||
DPRINTF("ignored short transfer, %d bytes\n", actlen);
|
||||
DPRINTF("ignored transfer, %d bytes\n", actlen);
|
||||
}
|
||||
|
||||
case USB_ST_SETUP:
|
||||
|
|
|
|||
Loading…
Reference in a new issue