aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2019-10-02 13:08:22 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2019-10-02 13:08:22 +0100
commit8c729c2b12ead68bcf11a3adfa6e465b0fae884f (patch)
tree26fd64b4d3e1bb60653df41cb5678e8fd6900c57
parent8c6cb8b6ba54ade58ae9f66f48eb6b20b4057f2d (diff)
downloadrspamd-8c729c2b12ead68bcf11a3adfa6e465b0fae884f.tar.gz
rspamd-8c729c2b12ead68bcf11a3adfa6e465b0fae884f.zip
[Fix] Do not assert if we have broken mime boundary in the headers
-rw-r--r--src/libmime/mime_parser.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/libmime/mime_parser.c b/src/libmime/mime_parser.c
index 1c132335c..517bc4b8d 100644
--- a/src/libmime/mime_parser.c
+++ b/src/libmime/mime_parser.c
@@ -688,10 +688,11 @@ rspamd_mime_parse_multipart_cb (struct rspamd_task *task,
st->pos = cb->part_start;
}
else {
- /* We have seen the start of the boundary */
- if (cb->part_start < pos) {
- /* We should have seen some boundary */
- g_assert (cb->cur_boundary != NULL);
+ /*
+ * We have seen the start of the boundary,
+ * but it might be unsuitable (e.g. in broken headers)
+ */
+ if (cb->part_start < pos && cb->cur_boundary) {
if ((ret = rspamd_mime_process_multipart_node (task, cb->st,
cb->multipart, cb->part_start, pos, TRUE, cb->err))