]> 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)
committerAndrew Lewis <nerf@judo.za.org>
Wed, 26 Jul 2017 20:18:18 +0000 (22:18 +0200)
src/libmime/mime_parser.c

index ab83c09ace83444acc9f3fbd04178779d48c5684..0c293f9a6aef2b3a781e161011e73d41b5ef5214 100644 (file)
@@ -280,11 +280,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;