Skip to content

Commit

Permalink
Fixed bug 4843 - Passing NULL to memset in SDL_PrivateLoadButtonMapping
Browse files Browse the repository at this point in the history
(Thanks!)
  • Loading branch information
1bsyl committed Oct 23, 2019
1 parent ed469fa commit 0f871c0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/joystick/SDL_gamecontroller.c
Expand Up @@ -691,7 +691,9 @@ static void SDL_PrivateLoadButtonMapping(SDL_GameController *gamecontroller, con

gamecontroller->name = pchName;
gamecontroller->num_bindings = 0;
SDL_memset(gamecontroller->last_match_axis, 0, gamecontroller->joystick->naxes * sizeof(*gamecontroller->last_match_axis));
if (gamecontroller->joystick->naxes) {
SDL_memset(gamecontroller->last_match_axis, 0, gamecontroller->joystick->naxes * sizeof(*gamecontroller->last_match_axis));
}

SDL_PrivateGameControllerParseControllerConfigString(gamecontroller, pchMapping);

Expand Down

0 comments on commit 0f871c0

Please sign in to comment.