Log:
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 <jgastal@...>
Author: etrunko
Date: 2010-09-14 11:29:30 -0700 (Tue, 14 Sep 2010)
New Revision: 52253
Modified:
trunk/eina/src/lib/eina_list.c
Modified: trunk/eina/src/lib/eina_list.c
===================================================================
--- trunk/eina/src/lib/eina_list.c 2010-09-14 18:17:23 UTC (rev 52252)
+++ trunk/eina/src/lib/eina_list.c 2010-09-14 18:29:30 UTC (rev 52253)
@@ -1859,6 +1859,9 @@
else if (tmp > cur)
for (; tmp != cur; tmp--, ct = ct->prev) ;
+ if (!ct)
+ goto end;
+
cmp = func(ct->data, data);
if (cmp == 0)
break;
|