From 6321dedff8851839569b68c72181caa141e069fa Mon Sep 17 00:00:00 2001 From: "huiyu.eun" Date: Tue, 18 Apr 2017 21:05:58 +0900 Subject: [PATCH] [SDL_Tizen] Fix Svace Issue -SDL_waylandevents.c : DEREF_OF_NULL -> Pointer 'window' that can have only NULL value(417 line). -SDL_test_fuzzer.c : UNREACHABLE_CODE -> line 261, 400, bufIdx (4 <= [0, 3]) is always false. Change-Id: Ie5bdd4a4da88a4b3b428f82df2bad9b97dbbbbf9 Signed-off-by: huiyu.eun --- src/test/SDL_test_fuzzer.c | 14 ++------------ src/video/wayland/SDL_waylandevents.c | 4 ++++ 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/src/test/SDL_test_fuzzer.c b/src/test/SDL_test_fuzzer.c index c8a7781..aa5e307 100644 --- a/src/test/SDL_test_fuzzer.c +++ b/src/test/SDL_test_fuzzer.c @@ -256,12 +256,7 @@ SDLTest_GenerateUnsignedBoundaryValues(const Uint64 maxValue, Uint64 boundary1, return 0; } - int bufIdx = SDLTest_RandomUint8() % index; - if(bufIdx>=4) - return 0; - - return tempBuf[bufIdx]; - + return tempBuf[SDLTest_RandomUint8() % index]; } @@ -393,13 +388,8 @@ SDLTest_GenerateSignedBoundaryValues(const Sint64 minValue, const Sint64 maxValu return minValue; } + return tempBuf[SDLTest_RandomUint8() % index]; - - int bufIdx = SDLTest_RandomUint8() % index; - if(bufIdx>=4) - return 0; - - return tempBuf[bufIdx]; } diff --git a/src/video/wayland/SDL_waylandevents.c b/src/video/wayland/SDL_waylandevents.c index 740676d..48c922d 100644 --- a/src/video/wayland/SDL_waylandevents.c +++ b/src/video/wayland/SDL_waylandevents.c @@ -426,6 +426,10 @@ wl_input_cb_touch_down(void *data, struct wl_touch *touch, unsigned int serial, input->pointer_focus = window; SDL_SetMouseFocus(window->sdlwindow); } + else + { + return; + } _get_normalized_coordinates(window, x, y, &normalized_x, &normalized_y); -- 2.7.4