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

hid.c: Fix reinitialization after an error #13

Closed
wants to merge 1 commit into from

Conversation

elad335
Copy link

@elad335 elad335 commented Apr 3, 2024

This should fix the crashes I experienced whenever DuelSense and DuelShock 4 got disconnected from bluetooth, either by battery shortage or manual shutdown from the controller.
The bug occured because data from the stack was used instead of dynamic memory to output the error after device connection errors, upon reinitialization (in an attempt to reconnect with the controller) the function got called again to clean the error buffer, but it called the C function free with an invalid pointer.
The crash occured inside of the free function.

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.

1 participant