Null termnate the pUserMappings variable to prevent memory corruption.
diff --git a/src/joystick/SDL_gamecontroller.c b/src/joystick/SDL_gamecontroller.c
index 51ce040..fc44bdb 100644
--- a/src/joystick/SDL_gamecontroller.c
+++ b/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;