Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
wants to merge 1 commit into from
Closed

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

wants to merge 1 commit into from

Conversation

Sneha1P
Copy link

@Sneha1P Sneha1P commented Mar 14, 2022

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.

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
Copy link

Youw commented Mar 14, 2022

Please see #468

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants