From bb6964cd6f474e6c04135310548f00cc2d3fe8c3 Mon Sep 17 00:00:00 2001 From: Maschell Date: Tue, 11 Apr 2017 14:38:53 +0200 Subject: [PATCH] Adding more checks for NULL-Pointer --- ControllerPatcher.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ControllerPatcher.cpp b/ControllerPatcher.cpp index e68bbf3..eb4695c 100644 --- a/ControllerPatcher.cpp +++ b/ControllerPatcher.cpp @@ -747,6 +747,7 @@ CONTROLLER_PATCHER_RESULT_OR_ERROR ControllerPatcher::gettingInputAllDevices(Inp } CONTROLLER_PATCHER_RESULT_OR_ERROR ControllerPatcher::setProControllerDataFromHID(void * data,s32 chan, s32 mode){ + if(data == NULL) return CONTROLLER_PATCHER_ERROR_NULL_POINTER; if(chan < 0 || chan > 3) return CONTROLLER_PATCHER_ERROR_INVALID_CHAN; //if(gControllerMapping.proController[chan].enabled == 0) return CONTROLLER_PATCHER_ERROR_MAPPING_DISABLED; @@ -809,6 +810,7 @@ CONTROLLER_PATCHER_RESULT_OR_ERROR ControllerPatcher::setProControllerDataFromHI } CONTROLLER_PATCHER_RESULT_OR_ERROR ControllerPatcher::setControllerDataFromHID(VPADData * buffer){ + if(buffer == NULL) return CONTROLLER_PATCHER_ERROR_NULL_POINTER; //if(gControllerMapping.gamepad.enabled == 0) return CONTROLLER_PATCHER_ERROR_MAPPING_DISABLED; s32 hidmask = 0;