diff --git a/libusb/os/windows_winusb.c b/libusb/os/windows_winusb.c index 545c59b..bccedb9 100644 --- a/libusb/os/windows_winusb.c +++ b/libusb/os/windows_winusb.c @@ -3357,11 +3357,13 @@ static int _hid_set_report(struct hid_device_priv *dev, HANDLE hid_handle, int i { uint8_t *buf = NULL; DWORD ioctl_code, write_size = (DWORD)*size; + // If an id is reported, we must allow MAX_HID_REPORT_SIZE + 1 + size_t max_report_size = MAX_HID_REPORT_SIZE + (id ? 1 : 0); if (tp->hid_buffer != NULL) usbi_dbg("program assertion failed: hid_buffer is not NULL"); - if ((*size == 0) || (*size > MAX_HID_REPORT_SIZE)) { + if ((*size == 0) || (*size > max_report_size)) { usbi_dbg("invalid size (%u)", *size); return LIBUSB_ERROR_INVALID_PARAM; } diff --git a/libusb/version_nano.h b/libusb/version_nano.h index e9b13cf..e9dbf91 100644 --- a/libusb/version_nano.h +++ b/libusb/version_nano.h @@ -1 +1 @@ -#define LIBUSB_NANO 11191 +#define LIBUSB_NANO 11192