From: Vsevolod Stakhov Date: Thu, 23 Feb 2023 11:41:40 +0000 (+0000) Subject: [Fix] Fix boundaries that contain only dashes X-Git-Tag: 3.5~39 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=50f86ebc28d752508af379dfc70bc390c5b1b814;p=thirdparty%2Frspamd.git [Fix] Fix boundaries that contain only dashes Issue: #4394 --- diff --git a/src/libmime/mime_parser.c b/src/libmime/mime_parser.c index 50e9f2fa70..538c057357 100644 --- a/src/libmime/mime_parser.c +++ b/src/libmime/mime_parser.c @@ -1162,7 +1162,6 @@ rspamd_mime_preprocess_cb (struct rspamd_multipattern *mp, task = st->task; if (G_LIKELY (p < end)) { - gboolean seen_non_dash = FALSE; blen = 0; @@ -1170,15 +1169,12 @@ rspamd_mime_preprocess_cb (struct rspamd_multipattern *mp, if (*p == '\r' || *p == '\n') { break; } - else if (*p != '-') { - seen_non_dash = TRUE; - } blen ++; p ++; } - if (blen > 0 && seen_non_dash) { + if (blen > 0) { /* We have found something like boundary */ p = text + match_pos; bend = p + blen - 1; @@ -1191,7 +1187,7 @@ rspamd_mime_preprocess_cb (struct rspamd_multipattern *mp, blen -= 2; } else { - /* Not a closing boundary somehow */ + /* Not a closing boundary somehow, e.g. if a boundary=='-' */ bend ++; } }