asdfuser pushed a commit to branch master.

commit 1cb5a8f63ab818c3cbf32142d99996fb80a7ad13
Author: Daniel Willmann <[email protected]>
Date:   Tue Apr 2 18:45:53 2013 +0100

    evas_textblock: Avoid dereferencing out-of-bounds element
    
    Address sanitizer found this. Not really a serious error as text[i] will
    be 0 in that case (I believe) and the loop is aborted in any case.
    
    Still, better safe than sorry.
    
    Signed-off-by: Daniel Willmann <[email protected]>
---
 src/lib/evas/canvas/evas_object_textblock.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/lib/evas/canvas/evas_object_textblock.c 
b/src/lib/evas/canvas/evas_object_textblock.c
index 6164fe8..564fb61 100644
--- a/src/lib/evas/canvas/evas_object_textblock.c
+++ b/src/lib/evas/canvas/evas_object_textblock.c
@@ -7053,7 +7053,7 @@ evas_textblock_cursor_word_end(Evas_Textblock_Cursor *cur)
         set_wordbreaks_utf32((const utf32_t *) text, len, lang, breaks);
      }
 
-   for (i = cur->pos; (BREAK_AFTER(i)) && (text[i]); i++);
+   for (i = cur->pos; (text[i]) && (BREAK_AFTER(i)); i++);
 
    for ( ; text[i] ; i++)
      {

-- 

------------------------------------------------------------------------------
Minimize network downtime and maximize team effectiveness.
Reduce network management and security costs.Learn how to hire 
the most talented Cisco Certified professionals. Visit the 
Employer Resources Portal
http://www.cisco.com/web/learning/employer_resources/index.html

Reply via email to