Do not memcpy in usbutils unless data was transferred.
diff --git a/usbutils.c b/usbutils.c
index 765a336..e123dce 100644
--- a/usbutils.c
+++ b/usbutils.c
@@ -2592,7 +2592,7 @@ err_retry:
}
if (err == LIBUSB_ERROR_IO && ++err_retries < USB_RETRY_MAX)
goto err_retry;
- if ((endpoint & LIBUSB_ENDPOINT_DIR_MASK) == LIBUSB_ENDPOINT_IN)
+ if (*transferred && (endpoint & LIBUSB_ENDPOINT_DIR_MASK) == LIBUSB_ENDPOINT_IN)
memcpy(data, buf, *transferred);
return err;