]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Check boundary before calling for U8_NEXT
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 5 Nov 2019 17:45:16 +0000 (17:45 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 5 Nov 2019 17:45:16 +0000 (17:45 +0000)
src/libmime/message.c

index 648fa82c517e9c1a66d5ea2a8143bc5078a31c2a..f3aba6001c4239bc1f0303205775f93cf2013ee7 100644 (file)
@@ -242,7 +242,7 @@ rspamd_strip_newlines_parse (struct rspamd_task *task,
                        U8_NEXT (begin, off, pe - begin, uc);
 
                        if (uc != -1) {
-                               while (p < pe) {
+                               while (p < pe && off < (pe - begin)) {
                                        if (IS_ZERO_WIDTH_SPACE (uc)) {
                                                /* Invisible space ! */
                                                task->flags |= RSPAMD_TASK_FLAG_BAD_UNICODE;