From owner-svn-src-all@FreeBSD.ORG Fri Oct 23 12:02:01 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9CEF91065692; Fri, 23 Oct 2009 12:02:01 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8AF4C8FC1A; Fri, 23 Oct 2009 12:02:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9NC21E8059954; Fri, 23 Oct 2009 12:02:01 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9NC21ce059952; Fri, 23 Oct 2009 12:02:01 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200910231202.n9NC21ce059952@svn.freebsd.org> From: Andrew Thompson Date: Fri, 23 Oct 2009 12:02:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198386 - stable/8/lib/libusb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Oct 2009 12:02:01 -0000 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;