]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Do not assert if we have broken mime boundary in the headers
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 2 Oct 2019 12:08:22 +0000 (13:08 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 2 Oct 2019 12:08:22 +0000 (13:08 +0100)
src/libmime/mime_parser.c

index 1c132335cffdd780b9b7dc52679261c75aa88906..517bc4b8dbc159279254cc5ab84a6ef887dfd817 100644 (file)
@@ -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))