From: Vsevolod Stakhov Date: Fri, 7 Apr 2017 12:17:42 +0000 (+0100) Subject: [Minor] Use safe version of utf8 macro X-Git-Tag: 1.5.5~25 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=2f536c9d4fa1216c9be8b25443a24e4b8f721925;p=rspamd.git [Minor] Use safe version of utf8 macro --- diff --git a/src/plugins/chartable.c b/src/plugins/chartable.c index 5ff7fc380..aed8ee804 100644 --- a/src/plugins/chartable.c +++ b/src/plugins/chartable.c @@ -191,7 +191,11 @@ rspamd_chartable_process_word_utf (struct rspamd_task *task, /* We assume that w is normalized */ while (p + i < end) { - U8_NEXT_UNSAFE (p, i, uc); + U8_NEXT (p, i, w->len, uc); + + if (((gint32)uc) < 0) { + break; + } if (u_isalpha (uc)) { sc = ublock_getCode (uc);