summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2014-12-24 13:13:45 +0800
committerPeng Wu <alexepico@gmail.com>2014-12-24 13:13:45 +0800
commit159039266a6b9530b9aad1362a8471aa80ea67fb (patch)
tree03aaecfa3abe73a8cbe026541d03113dcdad6008 /src
parent448c4cd67e317a62d953574d19175fc8ee811450 (diff)
downloadibus-libpinyin-159039266a6b9530b9aad1362a8471aa80ea67fb.tar.gz
ibus-libpinyin-159039266a6b9530b9aad1362a8471aa80ea67fb.tar.xz
ibus-libpinyin-159039266a6b9530b9aad1362a8471aa80ea67fb.zip
fixes a small issue in rememberUserInput
Diffstat (limited to 'src')
-rw-r--r--src/PYLibPinyin.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/PYLibPinyin.cc b/src/PYLibPinyin.cc
index 3ea3cff..0090c0c 100644
--- a/src/PYLibPinyin.cc
+++ b/src/PYLibPinyin.cc
@@ -274,6 +274,10 @@ LibPinyinBackEnd::rememberUserInput (pinyin_instance_t * instance)
/* pre-check the incomplete pinyin keys. */
guint len = 0;
g_assert (pinyin_get_n_pinyin (instance, &len));
+
+ if (0 == len || len >= MAX_PHRASE_LENGTH)
+ return FALSE;
+
size_t i = 0;
for ( ; i < len; ++i) {
PinyinKey *key = NULL;