commit 50f86eb: [Fix] Fix boundaries that contain only dashes
Vsevolod Stakhov
vsevolod at rspamd.com
Thu Feb 23 12:14:03 UTC 2023
Author: Vsevolod Stakhov
Date: 2023-02-23 11:41:40 +0000
URL: https://github.com/rspamd/rspamd/commit/50f86ebc28d752508af379dfc70bc390c5b1b814
[Fix] Fix boundaries that contain only dashes
Issue: #4394
---
src/libmime/mime_parser.c | 8 ++------
1 file 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 ++;
}
}
More information about the Commits
mailing list