From 89fba4b1eafad97c02cba939fa6430487dd6a27a Mon Sep 17 00:00:00 2001 From: jvcelak Date: Jun 23 2010 14:39:31 +0000 Subject: fixes invalid read causing segfault (#565904) --- diff --git a/libusb-0.1.12-invalid-read.patch b/libusb-0.1.12-invalid-read.patch new file mode 100644 index 0000000..28dc7e8 --- /dev/null +++ b/libusb-0.1.12-invalid-read.patch @@ -0,0 +1,21 @@ +diff -ru libusb-0.1.12.orig/descriptors.c libusb-0.1.12/descriptors.c +--- libusb-0.1.12.orig/descriptors.c 2006-03-04 02:52:46.000000000 +0000 ++++ libusb-0.1.12/descriptors.c 2010-02-16 17:31:42.000000000 +0000 +@@ -235,11 +235,12 @@ + } + + /* Did we hit an unexpected descriptor? */ +- usb_parse_descriptor(buffer, "bb", &header); +- if ((size >= DESC_HEADER_LENGTH) && +- ((header.bDescriptorType == USB_DT_CONFIG) || +- (header.bDescriptorType == USB_DT_DEVICE))) +- return parsed; ++ if (size >= DESC_HEADER_LENGTH) { ++ usb_parse_descriptor(buffer, "bb", &header); ++ if (((header.bDescriptorType == USB_DT_CONFIG) || ++ (header.bDescriptorType == USB_DT_DEVICE))) ++ return parsed; ++ } + + if (ifp->bNumEndpoints > USB_MAXENDPOINTS) { + if (usb_debug >= 1) diff --git a/libusb.spec b/libusb.spec index 71a1f18..fd8edb9 100644 --- a/libusb.spec +++ b/libusb.spec @@ -1,13 +1,14 @@ Summary: A library which allows userspace access to USB devices Name: libusb Version: 0.1.12 -Release: 22%{?dist} +Release: 23%{?dist} Source0: http://prdownloads.sourceforge.net/libusb/%{name}-%{version}.tar.gz Patch0: libusb-0.1.12-libusbconfig.patch Patch1: libusb-0.1.12-memset.patch Patch2: libusb-0.1.12-openat.patch Patch3: libusb-0.1.12-wakeups.patch Patch4: libusb-0.1.12-concurrency-timeout.patch +Patch5: libusb-0.1.12-invalid-read.patch License: LGPLv2+ Group: System Environment/Libraries BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -44,6 +45,7 @@ This package contains static libraries to develop applications that use libusb. %patch2 -p1 -b .openat #%patch3 -p0 -b .wakeups #%patch4 -p1 -b .concurrency-timeout +%patch5 -p1 -b .invalid-read %build autoconf @@ -83,6 +85,9 @@ rm -rf $RPM_BUILD_ROOT %{_libdir}/*.a %changelog +* Wed Jun 23 2010 Jan Vcelak 0.1.12-23 +- fixes invalid read causing segfault (#565904) + * Sat Jul 25 2009 Fedora Release Engineering - 0.1.12-22 - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild