summaryrefslogtreecommitdiff
path: root/libgphoto2_port/usb
diff options
context:
space:
mode:
authorHubert Figuiere <hub@figuiere.net>2001-08-13 21:44:40 +0000
committerHubert Figuiere <hub@figuiere.net>2001-08-13 21:44:40 +0000
commit7291a8401194f5759f6d90c3a2a2f038290059b7 (patch)
tree02a0efaf30606c87f71da7c8a9678d944b5fa1ab /libgphoto2_port/usb
parent73477e6ca011b719d34bb0b17b412813eac5985e (diff)
downloadlibgphoto2-7291a8401194f5759f6d90c3a2a2f038290059b7.tar.gz
* libgphoto2_port/usb/libusb.c (gp_port_usb_open): fix bug #438062:
a NULL usb_device* was passed to usb_dev_handle. git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@1988 67ed7778-7388-44ab-90cf-0a291f65f57c
Diffstat (limited to 'libgphoto2_port/usb')
-rw-r--r--libgphoto2_port/usb/libusb.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libgphoto2_port/usb/libusb.c b/libgphoto2_port/usb/libusb.c
index bf98d315e..0eae6a686 100644
--- a/libgphoto2_port/usb/libusb.c
+++ b/libgphoto2_port/usb/libusb.c
@@ -113,6 +113,10 @@ int gp_port_usb_open(gp_port *dev)
/* Open the device using the previous usb_handle returned by find_device */
udev = dev->device_handle;
+ if (!dev->device_handle) {
+ fprintf(stderr, "gp_port_usb_open: dev->device_handle is NULL\n");
+ return GP_ERROR_IO_OPEN;
+ }
dev->device_handle = usb_open(udev);
if (!dev->device_handle)
return GP_ERROR_IO_OPEN;