diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-04-07 13:17:42 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-04-07 13:17:42 +0100 |
commit | 2f536c9d4fa1216c9be8b25443a24e4b8f721925 (patch) | |
tree | c270fc560220d2d3d6113c5131664f99481b89b1 /src/plugins | |
parent | 486bf47d71e06debcdc0c7de5c5f0c4854c64fbd (diff) | |
download | rspamd-2f536c9d4fa1216c9be8b25443a24e4b8f721925.tar.gz rspamd-2f536c9d4fa1216c9be8b25443a24e4b8f721925.zip |
[Minor] Use safe version of utf8 macro
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/chartable.c | 6 |
1 files changed, 5 insertions, 1 deletions
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); |