1 more valgrind bitch gone. i know pos shouldnt exceed string array
authorraster <raster@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Wed, 25 Apr 2012 08:26:05 +0000 (08:26 +0000)
committerraster <raster@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Wed, 25 Apr 2012 08:26:05 +0000 (08:26 +0000)
bounds by logic but it crept through - this protects if it does.

git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/evas@70458 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/canvas/evas_object_textblock.c

index 617ffc7..1c171c9 100644 (file)
@@ -7411,7 +7411,9 @@ _evas_textblock_cursor_is_at_the_end(const Evas_Textblock_Cursor *cur)
 
    if (!cur) return EINA_FALSE;
    if (!cur->node) return EINA_FALSE;
+   if (cur->pos < 0) return EINA_FALSE;
    text = eina_ustrbuf_string_get(cur->node->unicode);
+   if ((cur->pos - 1) > eina_ustrbuf_length_get(cur->node->unicode)) return EINA_FALSE;
    return ((text[cur->pos] == 0) && (!EINA_INLIST_GET(cur->node)->next)) ?
               EINA_TRUE : EINA_FALSE;
 }