]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Avoid changing content-transfer-encoding header's value
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 13 Jul 2017 20:12:49 +0000 (21:12 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 13 Jul 2017 20:12:49 +0000 (21:12 +0100)
src/libmime/mime_parser.c

index d0862e7b453431ec453d8fe7840f82f9b564b9e7..ea6110e8d294375e8a68b5cd96f7c62f1518d796 100644 (file)
@@ -281,11 +281,12 @@ rspamd_mime_part_get_cte (struct rspamd_task *task,
        else {
                for (i = 0; i < hdrs_cte->len; i ++) {
                        gsize hlen;
+                       gchar lc_buf[128];
 
                        hdr = g_ptr_array_index (hdrs_cte, i);
-                       hlen = strlen (hdr->value);
-                       rspamd_str_lc (hdr->value, hlen);
-                       cte = rspamd_mime_parse_cte (hdr->value, hlen);
+                       hlen = rspamd_snprintf (lc_buf, sizeof (lc_buf), "%s", hdr->value);
+                       rspamd_str_lc (lc_buf, hlen);
+                       cte = rspamd_mime_parse_cte (lc_buf, hlen);
 
                        if (cte != RSPAMD_CTE_UNKNOWN) {
                                part->cte = cte;