You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In hid.c, function
hid_device * HID_API_EXPORT hid_open_path(const char *path) it looks like an error code is checked and printed - and then ignored?
`
/* Get Report Descriptor Size */
res = ioctl(dev->device_handle, HIDIOCGRDESCSIZE, &desc_size);
if (res < 0)
register_device_error_format(dev, "ioctl (GRDESCSIZE): %s", strerror(errno));
/* Get Report Descriptor */
rpt_desc.size = desc_size;
res = ioctl(dev->device_handle, HIDIOCGRDESC, &rpt_desc);
if (res < 0) {
register_device_error_format(dev, "ioctl (GRDESC): %s", strerror(errno));
} else {
/* Determine if this device uses numbered reports. */
dev->uses_numbered_reports =
uses_numbered_reports(rpt_desc.value,
rpt_desc.size);
}
`
I'm not sure what register_device_error_format does, but it does not seem to be diverting execution, so the desc_size is used even if reading it failed?
Good catch.
Agree, it should be handled properly.
The fact is - I don't believe this functionality needed at all for device to function. I'll clean it up next time I'll get to that code.
Activity
Youw commentedon Feb 21, 2022
Good catch.
Agree, it should be handled properly.
The fact is - I don't believe this functionality needed at all for device to function. I'll clean it up next time I'll get to that code.
Introduce HID_API_MAX_REPORT_DESCRIPTOR_SIZE (libusb#452)