← Back to team overview

registry team mailing list archive

[Bug 427805] Re: usb_find_devices() crashed with SIGSEGV in free()

 

The patch applied is actually very wrong. And it breaks for example gnokii.
If you look at the code you find this:

interface->altsetting = realloc(interface->altsetting, sizeof(struct
usb_interface_descriptor) * (interface->num_altsetting + 1));

Which means that the structure is reallocated to add new altsetting. If
you then zero the whole altsetting you zero all previous altsetting.
What about zeroing just allocated space? Please see the attached patch
(untested).

** Patch added: "libusb_memset_altsetting_alloc_02.patch"
   http://launchpadlibrarian.net/51646410/libusb_memset_altsetting_alloc_02.patch

-- 
usb_find_devices() crashed with SIGSEGV in free()
https://bugs.launchpad.net/bugs/427805
You received this bug notification because you are a member of Registry
Administrators, which is the registrant for libusb.