signal11 / hidapi

A Simple library for communicating with USB and Bluetooth HID devices on Linux, Mac, and Windows.
http://www.signal11.us/oss/hidapi/
Other
2.46k stars 901 forks source link

libusb: Fix double free of buffer pointer in hid_close() #473

Closed Sneha1P closed 2 years ago

Sneha1P commented 2 years ago

In hid_close() buffer pointer is freed and next to that the libusb_free_transfer function is called which checks for if the LIBUSB_TRANSFER_FREE_BUFFER flag is set and the buffer pointer is not NULL. when this condition evaluates true, it tries to free memory for a buffer which is already free and a crash occurs. Make buffer pointer NULL, once it is freed.

Youw commented 2 years ago

Please see #468