| Summary: | Passing NULL to memset in SDL_PrivateLoadButtonMapping | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Mathieu Eyraud <meyraud705> |
| Component: | joystick | Assignee: | Sam Lantinga <slouken> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | CC: | sylvain.becker |
| Version: | 2.0.10 | ||
| Hardware: | All | ||
| OS: | All | ||
| Attachments: | Check naxes before memset | ||
Thanks! Fixed in https://hg.libsdl.org/SDL/rev/e12b547e5856 |
Created attachment 3994 [details] Check naxes before memset If gamecontroller does not have any axis then NULL is passed to memset in SDL_PrivateLoadButtonMapping (src/joystick/SDL_gamecontroller.c line 694). In SDL_GameControllerOpen: gamecontroller->last_match_axis is initialized to NULL on line 1572 by calloc; Assuming gamecontroller has no axis on line 1586, gamecontroller->last_match_axis is still NULL; Calling SDL_PrivateLoadButtonMapping on line 1608; Calling memset on gamecontroller->last_match_axis on line 694.