diff options
author | Vsevolod Stakhov <vsevolod@rspamd.com> | 2023-02-23 11:41:40 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rspamd.com> | 2023-02-23 12:10:57 +0000 |
commit | 50f86ebc28d752508af379dfc70bc390c5b1b814 (patch) | |
tree | c2f932a3f33c42f6d551a5eaf2c763c24737786d | |
parent | a6f246370b8c3a17f7d888d9551d797a7df7140d (diff) | |
download | rspamd-50f86ebc28d752508af379dfc70bc390c5b1b814.tar.gz rspamd-50f86ebc28d752508af379dfc70bc390c5b1b814.zip |
[Fix] Fix boundaries that contain only dashes
Issue: #4394
-rw-r--r-- | src/libmime/mime_parser.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/libmime/mime_parser.c b/src/libmime/mime_parser.c index 50e9f2fa7..538c05735 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 ++; } } |