Null termnate the pUserMappings variable to prevent memory corruption.

This commit is contained in:
Sam Lantinga 2014-02-28 16:24:41 -08:00
parent e56bbe3f71
commit ab9345a896
1 changed files with 1 additions and 0 deletions

View File

@ -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;