From 159039266a6b9530b9aad1362a8471aa80ea67fb Mon Sep 17 00:00:00 2001 From: Peng Wu Date: Wed, 24 Dec 2014 13:13:45 +0800 Subject: fixes a small issue in rememberUserInput --- src/PYLibPinyin.cc | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') 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; -- cgit