diff options
author | David Shaw <[email protected]> | 2004-09-11 02:29:36 +0000 |
---|---|---|
committer | David Shaw <[email protected]> | 2004-09-11 02:29:36 +0000 |
commit | 0f48ec7bbacc1c922659c875737f0390a5060322 (patch) | |
tree | 26a2c7185b61e5755218c3e68a0642fa7d0ff1a2 | |
parent | * http.h: Add auth field for a parsed_uri to allow for basic auth. (diff) | |
download | gnupg-0f48ec7bbacc1c922659c875737f0390a5060322.tar.gz gnupg-0f48ec7bbacc1c922659c875737f0390a5060322.zip |
* ccid-driver.c (read_device_info): Fix segfault when usb device is not
accessible. (ccid_open_reader): Allow working with an even older version
of libusb (usb_busses global instead of usb_get_busses()).
Diffstat (limited to '')
-rw-r--r-- | g10/ChangeLog | 7 | ||||
-rw-r--r-- | g10/ccid-driver.c | 8 |
2 files changed, 15 insertions, 0 deletions
diff --git a/g10/ChangeLog b/g10/ChangeLog index 982401868..6696c0a69 100644 --- a/g10/ChangeLog +++ b/g10/ChangeLog @@ -1,3 +1,10 @@ +2004-09-10 David Shaw <[email protected]> + + * ccid-driver.c (read_device_info): Fix segfault when usb device + is not accessible. + (ccid_open_reader): Allow working with an even older version of + libusb (usb_busses global instead of usb_get_busses()). + 2004-09-09 Werner Koch <[email protected]> * cardglue.h: Add members for CA fingerprints. diff --git a/g10/ccid-driver.c b/g10/ccid-driver.c index 0fc168590..9847748f2 100644 --- a/g10/ccid-driver.c +++ b/g10/ccid-driver.c @@ -423,6 +423,9 @@ read_device_info (ccid_driver_t handle, struct usb_device *dev) struct usb_config_descriptor *config = dev->config + cfg_no; int ifc_no; + if(!config) + continue; + for (ifc_no=0; ifc_no < config->bNumInterfaces; ifc_no++) { struct usb_interface *interface = config->interface + ifc_no; @@ -564,7 +567,12 @@ ccid_open_reader (ccid_driver_t *handle, int readerno) usb_find_busses(); usb_find_devices(); + +#ifdef HAVE_USB_GET_BUSSES busses = usb_get_busses(); +#else + busses = usb_busses; +#endif for (bus = busses; bus; bus = bus->next) { |