summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2013-05-24 10:24:57 +0200
committerHans de Goede <hdegoede@redhat.com>2013-05-24 16:40:00 +0200
commitcf641bab1e699d12bb44a35949b8dd12970f6b5e (patch)
tree6371bff0d6db520521e4459267d1413051c3ccc4
parent6b41074352bec3e8fe132fc74768da8e930a2ab5 (diff)
downloadlibusb-cf641bab1e699d12bb44a35949b8dd12970f6b5e.tar.gz
all: ensure host_endian is always initialized
The get_device_descriptor backend call done from descriptor.c was passing in an uninitialized host_endian value. Likewise for the windows backend, host_endian was not being set from get_[active_]config_descriptor. Since the 2 problem cases are for different backend calls, we were never using an uninitialized host_endian, still lets set it everywhere for safety, Signed-off-by: Hans de Goede <hdegoede@redhat.com>
-rw-r--r--libusb/descriptor.c2
-rw-r--r--libusb/os/windows_usb.c1
-rw-r--r--libusb/version_nano.h2
3 files changed, 3 insertions, 2 deletions
diff --git a/libusb/descriptor.c b/libusb/descriptor.c
index 44d93ee..ea4ad39 100644
--- a/libusb/descriptor.c
+++ b/libusb/descriptor.c
@@ -495,7 +495,7 @@ static int raw_desc_to_config(struct libusb_context *ctx,
int usbi_device_cache_descriptor(libusb_device *dev)
{
- int r, host_endian;
+ int r, host_endian = 0;
r = usbi_backend->get_device_descriptor(dev, (unsigned char *) &dev->device_descriptor,
&host_endian);
diff --git a/libusb/os/windows_usb.c b/libusb/os/windows_usb.c
index 3eb5585..6d06128 100644
--- a/libusb/os/windows_usb.c
+++ b/libusb/os/windows_usb.c
@@ -1757,6 +1757,7 @@ static int windows_get_config_descriptor(struct libusb_device *dev, uint8_t conf
size = min(config_header->wTotalLength, len);
memcpy(buffer, priv->config_descriptor[config_index], size);
+ *host_endian = 0;
return size;
}
diff --git a/libusb/version_nano.h b/libusb/version_nano.h
index c29c8ff..2518a03 100644
--- a/libusb/version_nano.h
+++ b/libusb/version_nano.h
@@ -1 +1 @@
-#define LIBUSB_NANO 10714
+#define LIBUSB_NANO 10715