From 48ce05d71e782eb149a3ea41e05cb64f6270ffa7 Mon Sep 17 00:00:00 2001 From: "terry.rong" Date: Sat, 13 Jul 2024 01:14:07 +0800 Subject: [PATCH] fix(ime): fix buffer-overflow error in pingyin IME (#6501) Signed-off-by: rongyichang --- src/others/ime/lv_ime_pinyin.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/others/ime/lv_ime_pinyin.c b/src/others/ime/lv_ime_pinyin.c index 04155036c8..9343239f68 100644 --- a/src/others/ime/lv_ime_pinyin.c +++ b/src/others/ime/lv_ime_pinyin.c @@ -829,7 +829,7 @@ static void pinyin_page_proc(lv_obj_t * obj, uint16_t dir) uint16_t offset = pinyin_ime->py_page * (3 * LV_IME_PINYIN_CAND_TEXT_NUM); for(uint8_t i = 0; (i < pinyin_ime->cand_num && i < LV_IME_PINYIN_CAND_TEXT_NUM); i++) { if((remainder > 0) && (pinyin_ime->py_page == page_num)) { - if(i > remainder) + if(i >= remainder) break; } for(uint8_t j = 0; j < 3; j++) {