MFC r198376

Prevent wraparound of the timeout variable.

Submitted by:	HPS
Approved by:	re (kib)
This commit is contained in:
Andrew Thompson 2009-10-23 12:02:01 +00:00
parent dbd4bfe317
commit de411f4cd2
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/stable/8/; revision=198386

View File

@ -800,6 +800,10 @@ ugen20_tr_submit(struct libusb20_transfer *xfer)
if (xfer->flags & LIBUSB20_TRANSFER_DO_CLEAR_STALL) {
fsep->flags |= USB_FS_FLAG_CLEAR_STALL;
}
/* NOTE: The "fsep->timeout" variable is 16-bit. */
if (xfer->timeout > 65535)
fsep->timeout = 65535;
else
fsep->timeout = xfer->timeout;
temp.ep_index = xfer->trIndex;