svn commit: r198386 - stable/8/lib/libusb
Andrew Thompson
thompsa at FreeBSD.org
Fri Oct 23 12:02:01 UTC 2009
Author: thompsa
Date: Fri Oct 23 12:02:01 2009
New Revision: 198386
URL: http://svn.freebsd.org/changeset/base/198386
Log:
MFC r198376
Prevent wraparound of the timeout variable.
Submitted by: HPS
Approved by: re (kib)
Modified:
stable/8/lib/libusb/ (props changed)
stable/8/lib/libusb/libusb20_ugen20.c
stable/8/lib/libusb/usb.h (props changed)
Modified: stable/8/lib/libusb/libusb20_ugen20.c
==============================================================================
--- stable/8/lib/libusb/libusb20_ugen20.c Fri Oct 23 11:26:58 2009 (r198385)
+++ stable/8/lib/libusb/libusb20_ugen20.c Fri Oct 23 12:02:01 2009 (r198386)
@@ -800,7 +800,11 @@ ugen20_tr_submit(struct libusb20_transfe
if (xfer->flags & LIBUSB20_TRANSFER_DO_CLEAR_STALL) {
fsep->flags |= USB_FS_FLAG_CLEAR_STALL;
}
- fsep->timeout = xfer->timeout;
+ /* 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;
More information about the svn-src-stable
mailing list