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
devs/devilhorns/wayland_egl
Eduardo de Barros Lima 13 years ago
parent 47b00392a7
commit 2216c53641
  1. 3
      legacy/eina/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;

Loading…
Cancel
Save