[SDL_Tizen] Fix Svace Issue 11/125711/1 accepted/tizen/unified/20170419.165248 submit/tizen/20170419.044319
authorhuiyu.eun <huiyu.eun@samsung.com>
Tue, 18 Apr 2017 12:05:58 +0000 (21:05 +0900)
committerhuiyu.eun <huiyu.eun@samsung.com>
Tue, 18 Apr 2017 12:09:43 +0000 (21:09 +0900)
-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 <huiyu.eun@samsung.com>
src/test/SDL_test_fuzzer.c
src/video/wayland/SDL_waylandevents.c

index c8a7781..aa5e307 100644 (file)
@@ -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];
 }
 
 
index 740676d..48c922d 100644 (file)
@@ -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);