]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Properly deal with content type parameter
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 29 Mar 2017 16:02:21 +0000 (17:02 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 29 Mar 2017 16:02:39 +0000 (17:02 +0100)
src/libmime/message.c
src/libmime/mime_parser.c

index 91e32be3326aa00c2aa37beba87494be06d5a52b..f6d23b686a232be4d239ed756d9319446d792ad4 100644 (file)
@@ -441,7 +441,8 @@ rspamd_message_process_text_part (struct rspamd_task *task,
                }
 
                if (found_txt || found_html) {
-                       msg_info_task ("found text part with incorrect content-type: %T/%T",
+                       msg_info_task ("found %s part with incorrect content-type: %T/%T",
+                                       found_html ? "html" : "text",
                                        &mime_part->ct->type, &mime_part->ct->subtype);
                        mime_part->ct->flags |= RSPAMD_CONTENT_TYPE_BROKEN;
                }
index e994dc7959ce584c523cbda9c6f4e26590b7aedf..193a3808c1d090432e91f9499b1b78665144740f 100644 (file)
@@ -313,7 +313,8 @@ rspamd_mime_part_get_cd (struct rspamd_task *task, struct rspamd_mime_part *part
        guint i;
        GPtrArray *hdrs;
        struct rspamd_content_disposition *cd = NULL;
-       rspamd_ftok_t srch, *found;
+       rspamd_ftok_t srch;
+       struct rspamd_content_type_param *found;
 
        hdrs = rspamd_message_get_header_from_hash (part->raw_headers,
                        task->task_pool,
@@ -336,7 +337,7 @@ rspamd_mime_part_get_cd (struct rspamd_task *task, struct rspamd_mime_part *part
 
                        if (found) {
                                cd->type = RSPAMD_CT_ATTACHMENT;
-                               memcpy (&cd->filename, found, sizeof (cd->filename));
+                               memcpy (&cd->filename, &found->value, sizeof (cd->filename));
                        }
                }