diff options
-rw-r--r-- | libusb/os/windows_winusb.c | 3 | ||||
-rw-r--r-- | libusb/version_nano.h | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/libusb/os/windows_winusb.c b/libusb/os/windows_winusb.c index f8c84f7..3e3f0b4 100644 --- a/libusb/os/windows_winusb.c +++ b/libusb/os/windows_winusb.c @@ -4242,12 +4242,15 @@ static enum libusb_transfer_status hid_copy_transfer_data(int sub_api, struct us } if (transfer_priv->hid_buffer[0] == 0) { + length--; memcpy(transfer_priv->hid_dest, transfer_priv->hid_buffer + 1, length); } else { memcpy(transfer_priv->hid_dest, transfer_priv->hid_buffer, length); } } transfer_priv->hid_dest = NULL; + } else if ((length > 0) && (transfer_priv->hid_buffer[0] == 0)) { + length--; } // For write, we just need to free the hid buffer safe_free(transfer_priv->hid_buffer); diff --git a/libusb/version_nano.h b/libusb/version_nano.h index c9efb6d..fe58632 100644 --- a/libusb/version_nano.h +++ b/libusb/version_nano.h @@ -1 +1 @@ -#define LIBUSB_NANO 11750 +#define LIBUSB_NANO 11751 |