jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=daf87093f85972fc595560a3ac8537b6c74e01b0

commit daf87093f85972fc595560a3ac8537b6c74e01b0
Author: Jean-Philippe Andre <jp.an...@samsung.com>
Date:   Mon Jul 3 16:22:01 2017 +0900

    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.
---
 src/lib/eina/eina_file_common.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/lib/eina/eina_file_common.c b/src/lib/eina/eina_file_common.c
index 4b94d1d20c..8d7472bdd3 100644
--- a/src/lib/eina/eina_file_common.c
+++ b/src/lib/eina/eina_file_common.c
@@ -606,8 +606,8 @@ _eina_file_map_lines_iterator_next(Eina_Lines_Iterator *it, 
void **data)
    match = *it->current.end;
    if (it->current.index > 0)
      it->current.end++;
-   while ((*it->current.end == '\n' || *it->current.end == '\r')
-          && it->current.end < it->end)
+   while (it->current.end < it->end &&
+          (*it->current.end == '\n' || *it->current.end == '\r'))
      {
         if (match == *it->current.end)
           break;

-- 


Reply via email to