elm_genlist: prevent null pointer access
authorYeongjong Lee <yj34.lee@samsung.com>
Thu, 27 Sep 2018 05:08:39 +0000 (14:08 +0900)
committerYeongjong Lee <yj34.lee@samsung.com>
Fri, 28 Sep 2018 01:38:26 +0000 (10:38 +0900)
Summary: found by coverity

Reviewers: Hermet

Reviewed By: Hermet

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D7108

src/lib/elementary/elm_genlist.c

index 9b78753..809d9e6 100644 (file)
@@ -7060,8 +7060,11 @@ _elm_genlist_item_sorted_insert(Eo *obj, Elm_Genlist_Data *sd, const Elm_Genlist
                   if (rel->item->items)
                     {
                        Eina_List *ll = _list_last_recursive(rel->item->items);
-                       eo_rel = ll->data;
-                       rel = efl_data_scope_get(eo_rel, ELM_GENLIST_ITEM_CLASS);
+                       if (ll)
+                         {
+                            eo_rel = ll->data;
+                            rel = efl_data_scope_get(eo_rel, ELM_GENLIST_ITEM_CLASS);
+                         }
                     }
                   sd->items = eina_inlist_append_relative
                       (sd->items, EINA_INLIST_GET(it), EINA_INLIST_GET(rel));