forked from enlightenment/efl
eina file: Fix rare crash in line iteration
I'm not sure about the rest of this code, so it's possible that the index is increased even if it shouldn't. But I've observed a crash at this line, apparently when reaching the end pointer.
This commit is contained in:
parent
8906867500
commit
daf87093f8
|
@ -606,8 +606,8 @@ _eina_file_map_lines_iterator_next(Eina_Lines_Iterator *it, void **data)
|
||||||
match = *it->current.end;
|
match = *it->current.end;
|
||||||
if (it->current.index > 0)
|
if (it->current.index > 0)
|
||||||
it->current.end++;
|
it->current.end++;
|
||||||
while ((*it->current.end == '\n' || *it->current.end == '\r')
|
while (it->current.end < it->end &&
|
||||||
&& it->current.end < it->end)
|
(*it->current.end == '\n' || *it->current.end == '\r'))
|
||||||
{
|
{
|
||||||
if (match == *it->current.end)
|
if (match == *it->current.end)
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue