From 7268eabb9b0c6c48be65d89ce03adef637ed1469 Mon Sep 17 00:00:00 2001 From: Philipp Wiesemann Date: Sun, 26 Oct 2014 23:28:45 +0100 Subject: [PATCH] Added handling of NULL as input for SDL_GameControllerAddMapping(). --- src/joystick/SDL_gamecontroller.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/joystick/SDL_gamecontroller.c b/src/joystick/SDL_gamecontroller.c index 76b9b0689..633a23cd1 100644 --- a/src/joystick/SDL_gamecontroller.c +++ b/src/joystick/SDL_gamecontroller.c @@ -669,6 +669,10 @@ SDL_GameControllerAddMapping(const char *mappingString) ControllerMapping_t *pControllerMapping; SDL_bool is_xinput_mapping = SDL_FALSE; + if (!mappingString) { + return SDL_InvalidParamError("mappingString"); + } + pchGUID = SDL_PrivateGetControllerGUIDFromMappingString(mappingString); if (!pchGUID) { return SDL_SetError("Couldn't parse GUID from %s", mappingString);