diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-12-17 13:54:55 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-12-17 13:54:55 +0000 |
commit | 8e83bc2d1076daeb0de350b3fff6551054488efe (patch) | |
tree | 5d971fb83104d84365030b3e1895bc785d5e0c5b /src/libmime/mime_parser.c | |
parent | b07563f21324253b5e4aa6f1531f98a0f313d59c (diff) | |
download | rspamd-8e83bc2d1076daeb0de350b3fff6551054488efe.tar.gz rspamd-8e83bc2d1076daeb0de350b3fff6551054488efe.zip |
[Minor] Core: Store raw bondary in multipart node
Diffstat (limited to 'src/libmime/mime_parser.c')
-rw-r--r-- | src/libmime/mime_parser.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/libmime/mime_parser.c b/src/libmime/mime_parser.c index 5cfda74bf..3b84cbbbf 100644 --- a/src/libmime/mime_parser.c +++ b/src/libmime/mime_parser.c @@ -571,11 +571,11 @@ rspamd_mime_process_multipart_node (struct rspamd_task *task, npart->headers_order = g_queue_new (); if (multipart) { - if (multipart->specific.mp.children == NULL) { - multipart->specific.mp.children = g_ptr_array_sized_new (2); + if (multipart->specific.mp->children == NULL) { + multipart->specific.mp->children = g_ptr_array_sized_new (2); } - g_ptr_array_add (multipart->specific.mp.children, npart); + g_ptr_array_add (multipart->specific.mp->children, npart); } if (hdr_pos > 0 && hdr_pos < str.len) { @@ -635,6 +635,10 @@ rspamd_mime_process_multipart_node (struct rspamd_task *task, if (sel->flags & RSPAMD_CONTENT_TYPE_MULTIPART) { st->nesting ++; g_ptr_array_add (st->stack, npart); + npart->specific.mp = rspamd_mempool_alloc0 (task->task_pool, + sizeof (struct rspamd_mime_multipart)); + memcpy (&npart->specific.mp->boundary, &sel->orig_boundary, + sizeof (rspamd_ftok_t)); ret = rspamd_mime_parse_multipart_part (task, npart, st, err); } else if (sel->flags & RSPAMD_CONTENT_TYPE_MESSAGE) { @@ -1265,6 +1269,10 @@ rspamd_mime_parse_message (struct rspamd_task *task, if (sel->flags & RSPAMD_CONTENT_TYPE_MULTIPART) { g_ptr_array_add (nst->stack, npart); nst->nesting ++; + npart->specific.mp = rspamd_mempool_alloc0 (task->task_pool, + sizeof (struct rspamd_mime_multipart)); + memcpy (&npart->specific.mp->boundary, &sel->orig_boundary, + sizeof (rspamd_ftok_t)); ret = rspamd_mime_parse_multipart_part (task, npart, nst, err); } else if (sel->flags & RSPAMD_CONTENT_TYPE_MESSAGE) { |