commit 7d8bdf6: [Fix] Fix rfc2047 decoding for CD headers

Vsevolod Stakhov vsevolod at highsecure.ru
Wed Mar 6 13:56:03 UTC 2019


Author: Vsevolod Stakhov
Date: 2019-03-06 13:55:05 +0000
URL: https://github.com/rspamd/rspamd/commit/7d8bdf6c9e8a9d88a61cd8cf750c8c2e11786e21 (HEAD -> master)

[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 */


More information about the Commits mailing list