diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-11-12 13:45:04 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-11-12 13:45:04 +0000 |
commit | 65f8d2660f3186f218d16624053a47a9933cadb6 (patch) | |
tree | 146ed680f8fb6719bcaf7ab71672c93368b989ed | |
parent | 9826575c7a449c79d6cd99471c6d9cd74b4e91f9 (diff) | |
download | rspamd-65f8d2660f3186f218d16624053a47a9933cadb6.tar.gz rspamd-65f8d2660f3186f218d16624053a47a9933cadb6.zip |
[Fix] Ignore signatures when looking for boundaries
-rw-r--r-- | src/libmime/mime_parser.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/libmime/mime_parser.c b/src/libmime/mime_parser.c index 37b312f44..9ce39ad16 100644 --- a/src/libmime/mime_parser.c +++ b/src/libmime/mime_parser.c @@ -871,10 +871,25 @@ rspamd_mime_preprocess_cb (struct rspamd_multipattern *mp, task = st->task; if (G_LIKELY (p < end)) { - blen = rspamd_memcspn (p, "\r\n", end - p); + gboolean seen_non_dash = FALSE; - if (blen > 0) { + blen = 0; + + while (p < end) { + if (*p == '\r' || *p == '\n') { + break; + } + else if (*p != '-') { + seen_non_dash = TRUE; + } + + blen ++; + p ++; + } + + if (blen > 0 && seen_non_dash) { /* We have found something like boundary */ + p = text + match_pos; bend = p + blen - 1; if (*bend == '-') { |