Added handling of NULL as input for SDL_GameControllerAddMapping().
authorPhilipp Wiesemann <philipp.wiesemann@arcor.de>
Sun, 26 Oct 2014 23:28:45 +0100
changeset 9198 7260f8242948
parent 9197 90bb83c49dea
child 9199 9418826f6341
Added handling of NULL as input for SDL_GameControllerAddMapping().
src/joystick/SDL_gamecontroller.c
--- a/src/joystick/SDL_gamecontroller.c	Sun Oct 26 23:22:53 2014 +0100
+++ b/src/joystick/SDL_gamecontroller.c	Sun Oct 26 23:28:45 2014 +0100
@@ -669,6 +669,10 @@
     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);