elm_code: Fix invalid read of 1 byte

After end of string...
This commit is contained in:
Jean-Philippe Andre 2017-05-17 15:21:52 +09:00
parent 90de99eea6
commit daabd44520
1 changed files with 3 additions and 1 deletions

View File

@ -174,7 +174,9 @@ _elm_code_widget_line_text_position_for_column_get(Eo *obj, Elm_Code_Widget_Data
while ((unsigned int) count <= column && index <= (int) line->length)
{
position = (unsigned int) index;
unicode = eina_unicode_utf8_next_get(chars, &index);
if (index < (int) line->length)
unicode = eina_unicode_utf8_next_get(chars, &index);
else return line->length;
if (unicode == 0)
return line->length;