summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2017-05-17 15:21:52 +0900
committerAndy Williams <andy@andywilliams.me>2017-05-17 08:36:00 +0100
commit7dd61651e35ee1044f0830d251abb84154d9cc72 (patch)
treed292c7d7458496d4a60de7742797ae281708da13
parentf425f041b3f864f44da8a6516414ca12203dbf24 (diff)
elm_code: Fix invalid read of 1 byte
After end of string...
-rw-r--r--src/lib/elementary/elm_code_widget_text.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lib/elementary/elm_code_widget_text.c b/src/lib/elementary/elm_code_widget_text.c
index a2098a29fe..879a0a7ecf 100644
--- a/src/lib/elementary/elm_code_widget_text.c
+++ b/src/lib/elementary/elm_code_widget_text.c
@@ -174,7 +174,9 @@ _elm_code_widget_line_text_position_for_column_get(Eo *obj, Elm_Code_Widget_Data
174 while ((unsigned int) count <= column && index <= (int) line->length) 174 while ((unsigned int) count <= column && index <= (int) line->length)
175 { 175 {
176 position = (unsigned int) index; 176 position = (unsigned int) index;
177 unicode = eina_unicode_utf8_next_get(chars, &index); 177 if (index < (int) line->length)
178 unicode = eina_unicode_utf8_next_get(chars, &index);
179 else return line->length;
178 180
179 if (unicode == 0) 181 if (unicode == 0)
180 return line->length; 182 return line->length;