Skip to content

Commit

Permalink
Null termnate the pUserMappings variable to prevent memory corruption.
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Mar 1, 2014
1 parent e56bbe3 commit ab9345a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/joystick/SDL_gamecontroller.c
Expand Up @@ -835,6 +835,7 @@ SDL_GameControllerLoadHints()
char *pUserMappings = SDL_malloc( nchHints + 1 );
char *pTempMappings = pUserMappings;
SDL_memcpy( pUserMappings, hint, nchHints );
pUserMappings[nchHints] = '\0';
while ( pUserMappings ) {
char *pchNewLine = NULL;

Expand Down

0 comments on commit ab9345a

Please sign in to comment.