mirror of
https://github.com/encounter/SDL.git
synced 2025-12-09 05:27:48 +00:00
Null termnate the pUserMappings variable to prevent memory corruption.
This commit is contained in:
@@ -835,6 +835,7 @@ SDL_GameControllerLoadHints()
|
|||||||
char *pUserMappings = SDL_malloc( nchHints + 1 );
|
char *pUserMappings = SDL_malloc( nchHints + 1 );
|
||||||
char *pTempMappings = pUserMappings;
|
char *pTempMappings = pUserMappings;
|
||||||
SDL_memcpy( pUserMappings, hint, nchHints );
|
SDL_memcpy( pUserMappings, hint, nchHints );
|
||||||
|
pUserMappings[nchHints] = '\0';
|
||||||
while ( pUserMappings ) {
|
while ( pUserMappings ) {
|
||||||
char *pchNewLine = NULL;
|
char *pchNewLine = NULL;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user