From owner-svn-src-all@FreeBSD.ORG Thu Oct 22 21:01:41 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 BB39B1065693; Thu, 22 Oct 2009 21:01:41 +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 AAABA8FC19; Thu, 22 Oct 2009 21:01:41 +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 n9ML1fq7040073; Thu, 22 Oct 2009 21:01:41 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9ML1fT9040071; Thu, 22 Oct 2009 21:01:41 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200910222101.n9ML1fT9040071@svn.freebsd.org> From: Andrew Thompson Date: Thu, 22 Oct 2009 21:01:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198376 - head/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: Thu, 22 Oct 2009 21:01:41 -0000 Author: thompsa Date: Thu Oct 22 21:01:41 2009 New Revision: 198376 URL: http://svn.freebsd.org/changeset/base/198376 Log: Prevent wraparound of the timeout variable. Submitted by: HPS Modified: head/lib/libusb/libusb20_ugen20.c Modified: head/lib/libusb/libusb20_ugen20.c ============================================================================== --- head/lib/libusb/libusb20_ugen20.c Thu Oct 22 20:59:51 2009 (r198375) +++ head/lib/libusb/libusb20_ugen20.c Thu Oct 22 21:01:41 2009 (r198376) @@ -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;