dfu_util: bugfix for crash

Satz Klauer satzklauer at googlemail.com
Wed Nov 16 18:45:42 CET 2011


Hi,

I found a small bug in dfu_util, file main.c function find_dfu_if() line 86:

There a function libusb_get_config_descriptor(dev, cfg_idx, &cfg); is
called without checking the return code. In case it fails cfg is
invalid and will lead to an crash some lines later.

Something like

rc=libusb_get_config_descriptor(dev, cfg_idx, &cfg);
if (rc<0) return rc;
/* in some cases, noticably FreeBSD if uid != 0,
 * the configuration descriptors are empty */

would fix that problem.

Elmi



More information about the devel mailing list