| Summary: | SDL_hapticlist/_tail not set correctly | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Zachary L <admin> |
| Component: | haptic | Assignee: | Edgar Simo <bobbens> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | ||
| Version: | HG 2.1 | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Attachments: | Patch containing mentioned fix. | ||
Fixed, thanks! https://hg.libsdl.org/SDL/rev/5192470456ae |
Created attachment 1662 [details] Patch containing mentioned fix. SDL_hapticlist and SDL_hapticlist_tail are not set correctly when quitting the subsystem. This matters because they are represented as global variables. In the case you quit and reinitialize the subsystems, problems with dangling pointers arise. For instance, SDL_hapticlist_tail will not be null on second initialization and because of the check on line 298, it will fail to set SDL_hapticlist appropriately. This can cause a few things to go wrong, like feeding SDL_strcmp a null fname which can cause a segfault. This patch is simple. It just sets SDL_hapticlist and SDL_hapticlist_tail to NULL.