From 7d8bdf6c9e8a9d88a61cd8cf750c8c2e11786e21 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Wed, 6 Mar 2019 13:55:05 +0000 Subject: [PATCH] [Fix] Fix rfc2047 decoding for CD headers --- src/libmime/mime_parser.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/libmime/mime_parser.c b/src/libmime/mime_parser.c index 21a81575d..dc55efe20 100644 --- a/src/libmime/mime_parser.c +++ b/src/libmime/mime_parser.c @@ -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 */ -- 2.39.5