From: etrunko Date: Tue, 14 Sep 2010 18:29:30 +0000 (+0000) Subject: Eina_List: Avoid Segfault X-Git-Tag: 2.0_alpha~70^2~351 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d9a1b23e549a9cab5d17765bdec8dcd078d92881;p=framework%2Fuifw%2Feina.git Eina_List: Avoid Segfault Some inputs in which tmp - cur is greater than the number of previous nodes in list, were causing ct to be null at end of loop. Patch by Jonas M. Gastal git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/eina@52253 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- diff --git a/src/lib/eina_list.c b/src/lib/eina_list.c index 68f5b3e..3ce6131 100644 --- a/src/lib/eina_list.c +++ b/src/lib/eina_list.c @@ -1859,6 +1859,9 @@ eina_list_search_sorted_near_list(const Eina_List *list, else if (tmp > cur) for (; tmp != cur; tmp--, ct = ct->prev) ; + if (!ct) + goto end; + cmp = func(ct->data, data); if (cmp == 0) break;