From: Vsevolod Stakhov Date: Mon, 9 Aug 2021 13:09:00 +0000 (+0100) Subject: [Minor] Do not go into utf8 checks on non utf8 leading characters X-Git-Tag: 3.0~31 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=86e3a152fbf073ec59df0f2b18a825b27ce6b710;p=rspamd.git [Minor] Do not go into utf8 checks on non utf8 leading characters --- diff --git a/src/libmime/message.c b/src/libmime/message.c index 532667e5d..d788844a3 100644 --- a/src/libmime/message.c +++ b/src/libmime/message.c @@ -240,7 +240,7 @@ rspamd_strip_newlines_parse (struct rspamd_task *task, } state = normal_char; while (p < pe) { - if (is_utf) { + if (U8_IS_LEAD(*p) && is_utf) { gint32 off = p - begin; U8_NEXT (begin, off, pe - begin, uc);