]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Fix rfc2047 decoding for CD headers
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 6 Mar 2019 13:55:05 +0000 (13:55 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 6 Mar 2019 13:55:05 +0000 (13:55 +0000)
src/libmime/mime_parser.c

index 21a81575d26264e49714ba284bd41cc5b3711c60..dc55efe205edbfd797a20eb894b2424c0f09e2c8 100644 (file)
@@ -371,9 +371,13 @@ rspamd_mime_part_get_cd (struct rspamd_task *task, struct rspamd_mime_part *part
                        gsize hlen;
 
                        hdr = g_ptr_array_index (hdrs, i);
-                       hlen = strlen (hdr->value);
-                       cd = rspamd_content_disposition_parse (hdr->value, hlen,
-                                       task->task_pool);
+                       cd = NULL;
+
+                       if (hdr->decoded) {
+                               hlen = strlen (hdr->decoded);
+                               cd = rspamd_content_disposition_parse (hdr->decoded, hlen,
+                                               task->task_pool);
+                       }
 
                        if (cd) {
                                /* We still need to check filename */