diff options
author | Jean-Philippe Andre <jp.andre@samsung.com> | 2017-05-17 15:21:52 +0900 |
---|---|---|
committer | Jean-Philippe Andre <jp.andre@samsung.com> | 2017-05-17 15:32:03 +0900 |
commit | daabd44520aa4b43dfd57ecd07bf8fe589705e14 (patch) | |
tree | 697d9b11584129732a8692cfa3e65320fa0fb039 | |
parent | 90de99eea632a9200816bcc18412e171f843ec59 (diff) | |
download | efl-daabd44520aa4b43dfd57ecd07bf8fe589705e14.tar.gz |
elm_code: Fix invalid read of 1 byte
After end of string...
-rw-r--r-- | src/lib/elementary/elm_code_widget_text.c | 4 |
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 a06fb8aa0b..afdff5e9a0 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 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; |