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@profusion.mobi>



SVN revision: 52253
This commit is contained in:
Eduardo de Barros Lima 2010-09-14 18:29:30 +00:00
parent 47b00392a7
commit 2216c53641
1 changed files with 3 additions and 0 deletions

View File

@ -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;