projects
/
platform
/
upstream
/
libusb.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
45ae2ae
)
Darwin: fix crash when reading descriptors after close
author
Nathan Hjelm
<hjelmn@mac.com>
Sun, 23 Aug 2009 04:17:55 +0000
(10:02 +0545)
committer
Daniel Drake
<dsd@gentoo.org>
Sun, 23 Aug 2009 04:17:55 +0000
(10:02 +0545)
Fix a crash which occurs if the user does the following sequence on a
device: open, close, get_configuration_descriptor.
libusb/os/darwin_usb.c
patch
|
blob
|
history
diff --git
a/libusb/os/darwin_usb.c
b/libusb/os/darwin_usb.c
index
9e12e07
..
8c1afec
100644
(file)
--- a/
libusb/os/darwin_usb.c
+++ b/
libusb/os/darwin_usb.c
@@
-652,6
+652,9
@@
static void darwin_close (struct libusb_device_handle *dev_handle) {
usbi_remove_pollfd (HANDLE_CTX (dev_handle), priv->fds[0]);
close (priv->fds[1]);
close (priv->fds[0]);
+
+ dpriv->device = NULL;
+ priv->fds[0] = priv->fds[1] = -1;
}
static int darwin_get_configuration(struct libusb_device_handle *dev_handle, int *config) {