From: Vsevolod Stakhov Date: Tue, 5 Nov 2019 17:45:16 +0000 (+0000) Subject: [Minor] Check boundary before calling for U8_NEXT X-Git-Tag: 2.2~76 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1e7b5d6fed44f53ea87090b5480112230ec8e044;p=thirdparty%2Frspamd.git [Minor] Check boundary before calling for U8_NEXT --- diff --git a/src/libmime/message.c b/src/libmime/message.c index 648fa82c51..f3aba6001c 100644 --- a/src/libmime/message.c +++ b/src/libmime/message.c @@ -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;