diff options
author | Jihoon Kim <jihoon48.kim@samsung.com> | 2014-10-08 14:24:14 +0900 |
---|---|---|
committer | Jihoon Kim <jihoon48.kim@samsung.com> | 2014-10-10 10:03:48 +0900 |
commit | eac57a010bd95dcf9114fe85a26c03089fa879a6 (patch) | |
tree | 47bf1abe43e3562536de532c27deebebd7577e19 | |
parent | f294fdc3a1d0c648353eae2185ca2c53e4630949 (diff) | |
download | efl-eac57a010bd95dcf9114fe85a26c03089fa879a6.tar.gz |
ecore_imf/wayland: fix infinite loop bug when ibus-hangul is used
When korean language was typed with ibus-hangul,
wayland immodule falled into the infinite loop.
-rw-r--r-- | src/modules/ecore_imf/wayland/wayland_imcontext.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/modules/ecore_imf/wayland/wayland_imcontext.c b/src/modules/ecore_imf/wayland/wayland_imcontext.c index a83b493ecc..70b8cabb44 100644 --- a/src/modules/ecore_imf/wayland/wayland_imcontext.c +++ b/src/modules/ecore_imf/wayland/wayland_imcontext.c @@ -82,6 +82,14 @@ utf8_offset_to_characters(const char *str, int offset) { int index = 0; unsigned int i = 0; + int len = 0; + + if (!str) return 0; + + len = strlen(str); + + if (offset > len) + offset = len; for (; index < offset; i++) eina_unicode_utf8_next_get(str, &index); |