[Fix prevent issue]
authorShinwoo Kim <cinoo.kim@samsung.com>
Tue, 23 Jun 2015 05:26:55 +0000 (14:26 +0900)
committerShinwoo Kim <cinoo.kim@samsung.com>
Tue, 23 Jun 2015 06:29:15 +0000 (15:29 +0900)
[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
src/navigator.c
src/screen_reader_vconf.c
src/smart_notification.c
src/window_tracker.c

index a3791a7..44a2cf0 100644 (file)
@@ -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;
index 4310caf..f45a5e0 100644 (file)
@@ -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);
 
index 0427651..d6818ad 100644 (file)
@@ -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)
index f26a81b..0c8cc48 100644 (file)
@@ -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);
 
index ecb5e40..6ef82f1 100644 (file)
@@ -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;