Skip to content
Permalink
Browse files

Null termnate the pUserMappings variable to prevent memory corruption.

  • Loading branch information
slouken committed Mar 1, 2014
1 parent e56bbe3 commit ab9345a896dc509a6414db44362a4833f24c2fa4
Showing with 1 addition and 0 deletions.
  1. +1 −0 src/joystick/SDL_gamecontroller.c
@@ -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;

0 comments on commit ab9345a

Please sign in to comment.