| Summary: | [Patch] HIDAPI_JoystickDisconnected incorrect array shift | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Anthony Pesch <inolen> |
| Component: | joystick | Assignee: | Sam Lantinga <slouken> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | ||
| Version: | HG 2.1 | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
| Attachments: | scale memmove size by sizeof(SDL_JoystickID) | ||
Fixed, thanks! https://hg.libsdl.org/SDL/rev/44fbeca0872e |
Created attachment 4355 [details] scale memmove size by sizeof(SDL_JoystickID) Hi Sam, I was looking into my own input bug and noticed an issue in the HIDAPI code while looking over it. I don't have a controller that goes down this path to test and try to provoke the issue, but it looks pretty straight forward. The memmove to shift the joystick id array on disconnect isn't scaling the size by sizeof(SDL_JoystickID), likely corrupting the ids on disconnect.