]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Use safe version of utf8 macro
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 7 Apr 2017 12:17:42 +0000 (13:17 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 7 Apr 2017 12:17:42 +0000 (13:17 +0100)
src/plugins/chartable.c

index 5ff7fc380a2887754aff9836b53b58db1509bb6f..aed8ee8047e2c7a36cfe109b3ee65ad929fc8745 100644 (file)
@@ -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);