Date: Mon, 28 Sep 2009 07:39:52 +0000 (UTC) From: Andrew Thompson <thompsa@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r197558 - head/sys/dev/usb Message-ID: <200909280739.n8S7dqww046883@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: thompsa Date: Mon Sep 28 07:39:51 2009 New Revision: 197558 URL: http://svn.freebsd.org/changeset/base/197558 Log: Fix NULL-pointer dereference in usb_endpoint_foreach(). PR: usb/138389 Submitted by: Patroklos Argyroudis at census, inc Modified: head/sys/dev/usb/usb_device.c Modified: head/sys/dev/usb/usb_device.c ============================================================================== --- head/sys/dev/usb/usb_device.c Mon Sep 28 07:32:11 2009 (r197557) +++ head/sys/dev/usb/usb_device.c Mon Sep 28 07:39:51 2009 (r197558) @@ -367,12 +367,14 @@ usb_init_endpoint(struct usb_device *ude struct usb_endpoint * usb_endpoint_foreach(struct usb_device *udev, struct usb_endpoint *ep) { - struct usb_endpoint *ep_end = udev->endpoints + udev->endpoints_max; + struct usb_endpoint *ep_end; /* be NULL safe */ if (udev == NULL) return (NULL); + ep_end = udev->endpoints + udev->endpoints_max; + /* get next endpoint */ if (ep == NULL) ep = udev->endpoints;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200909280739.n8S7dqww046883>