From d49d755ff5c1f7cac949d74cb5d50bffbc57de37 Mon Sep 17 00:00:00 2001 From: Shinwoo Kim Date: Tue, 23 Jun 2015 14:26:55 +0900 Subject: [PATCH] [Fix prevent issue] [CID 451131] flat_navi.c:_contains - dereference null return value [CID 451136] navigator.c:_focus_next_visible - dereference null return value [CID 451143] navigator.c:_focus_prev_visible - dereference null return value [CID 451109] screen_reader_vconf.c:set_language - Array compared against 0 [CID 451144] smart_notification.c:get_realized_items_count - dereference null return value [CID 451141] window_tracker.c:_get_window_object_from_given - dereference null return value Change-Id: I64d343a6d163bd8747323b402f6a86141daa9ad5 --- src/flat_navi.c | 4 ++-- src/navigator.c | 18 ++++++++++++------ src/screen_reader_vconf.c | 2 +- src/smart_notification.c | 1 + src/window_tracker.c | 3 +++ 5 files changed, 19 insertions(+), 9 deletions(-) diff --git a/src/flat_navi.c b/src/flat_navi.c index a3791a7..44a2cf0 100644 --- a/src/flat_navi.c +++ b/src/flat_navi.c @@ -289,8 +289,8 @@ _contains(AtspiAccessible *obj, gint x, gint y) { const ObjectCache *oc = object_cache_get(obj); - if (x >= oc->bounds->x && x <= oc->bounds->x + oc->bounds->width - && y >= oc->bounds->y && y <= oc->bounds->y + oc->bounds->height) + if (oc && x >= oc->bounds->x && x <= oc->bounds->x + oc->bounds->width + && y >= oc->bounds->y && y <= oc->bounds->y + oc->bounds->height) { DEBUG("INSIDE"); return EINA_TRUE; diff --git a/src/navigator.c b/src/navigator.c index 4310caf..f45a5e0 100644 --- a/src/navigator.c +++ b/src/navigator.c @@ -617,9 +617,12 @@ static void _focus_next_visible(void) if (!obj) obj = flat_navi_context_line_next(context); // try 'cycle' objects in context - ss = atspi_accessible_get_state_set(obj); - visible = atspi_state_set_contains(ss, ATSPI_STATE_SHOWING); - g_object_unref(ss); + if (obj) + { + ss = atspi_accessible_get_state_set(obj); + visible = atspi_state_set_contains(ss, ATSPI_STATE_SHOWING); + g_object_unref(ss); + } } while (obj && !visible); @@ -647,9 +650,12 @@ static void _focus_prev_visible(void) if (!obj) obj = flat_navi_context_line_prev(context); // try 'cycle' objects in context - ss = atspi_accessible_get_state_set(obj); - visible = atspi_state_set_contains(ss, ATSPI_STATE_SHOWING); - g_object_unref(ss); + if (obj) + { + ss = atspi_accessible_get_state_set(obj); + visible = atspi_state_set_contains(ss, ATSPI_STATE_SHOWING); + g_object_unref(ss); + } } while (obj && !visible); diff --git a/src/screen_reader_vconf.c b/src/screen_reader_vconf.c index 0427651..d6818ad 100644 --- a/src/screen_reader_vconf.c +++ b/src/screen_reader_vconf.c @@ -23,7 +23,7 @@ bool set_langauge(Service_Data *sd, const char *new_language, int new_voice) Eina_List *l; Voice_Info *vi; - if (!sd->language || !new_language) + if (!new_language) return false; if(strncmp(sd->language, new_language, LAN_NAME - 1) == 0 && sd->voice_type == new_voice) diff --git a/src/smart_notification.c b/src/smart_notification.c index f26a81b..0c8cc48 100644 --- a/src/smart_notification.c +++ b/src/smart_notification.c @@ -69,6 +69,7 @@ void get_realized_items_count(AtspiAccessible *scrollable_object, int *start_idx for(jdx = 0; jdx < count_child; jdx++) { child_iter = atspi_accessible_get_child_at_index(scrollable_object, jdx, NULL); + if (!child_iter) continue; AtspiStateSet* state_set = atspi_accessible_get_state_set(child_iter); diff --git a/src/window_tracker.c b/src/window_tracker.c index ecb5e40..6ef82f1 100644 --- a/src/window_tracker.c +++ b/src/window_tracker.c @@ -35,6 +35,9 @@ _get_window_object_from_given(AtspiAccessible *obj) for (j=0; j < app_childs; j++) { win = atspi_accessible_get_child_at_index(app, j, NULL); + if (!win) + continue; + st = atspi_accessible_get_state_set (win); if (atspi_state_set_contains(st, ATSPI_STATE_ACTIVE)) ret = win; -- 2.7.4