aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2016-12-21 15:09:50 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2016-12-21 15:26:59 +0000
commit066e21615a70a2317c1a0f9747ba090af0b7e1ea (patch)
tree199f549fa201a7fef39a43633d9a45f673665f20 /src
parentcb8a4142d1c9c4eed1fd94225a7039e05607e48b (diff)
downloadrspamd-066e21615a70a2317c1a0f9747ba090af0b7e1ea.tar.gz
rspamd-066e21615a70a2317c1a0f9747ba090af0b7e1ea.zip
[Fix] Decode filename in content disposition
Diffstat (limited to 'src')
-rw-r--r--src/libmime/content_type.c7
-rw-r--r--src/libmime/mime_parser.c1
2 files changed, 4 insertions, 4 deletions
diff --git a/src/libmime/content_type.c b/src/libmime/content_type.c
index a002d0884..1fc1db565 100644
--- a/src/libmime/content_type.c
+++ b/src/libmime/content_type.c
@@ -163,6 +163,7 @@ rspamd_content_disposition_add_param (rspamd_mempool_t *pool,
const gchar *value_start, const gchar *value_end)
{
rspamd_ftok_t srch;
+ gchar *decoded;
struct rspamd_content_type_param *found = NULL, *nparam;
g_assert (cd != NULL);
@@ -181,8 +182,8 @@ rspamd_content_disposition_add_param (rspamd_mempool_t *pool,
nparam = rspamd_mempool_alloc (pool, sizeof (*nparam));
nparam->name.begin = name_start;
nparam->name.len = name_end - name_start;
- nparam->value.begin = value_start;
- nparam->value.len = value_end - value_start;
+ decoded = rspamd_mime_header_decode (pool, value_start, value_end - value_start);
+ RSPAMD_FTOK_FROM_STR (&nparam->value, decoded);
DL_APPEND (found, nparam);
if (!found) {
@@ -193,7 +194,7 @@ rspamd_content_disposition_add_param (rspamd_mempool_t *pool,
srch.len = 8;
if (rspamd_ftok_cmp (&nparam->name, &srch) == 0) {
- /* Adjust charset */
+ /* Adjust filename */
cd->filename.begin = nparam->value.begin;
cd->filename.len = nparam->value.len;
}
diff --git a/src/libmime/mime_parser.c b/src/libmime/mime_parser.c
index d9687ce97..f113121ba 100644
--- a/src/libmime/mime_parser.c
+++ b/src/libmime/mime_parser.c
@@ -256,7 +256,6 @@ rspamd_mime_part_get_cd (struct rspamd_task *task, struct rspamd_mime_part *part
hdr = g_ptr_array_index (hdrs, i);
hlen = strlen (hdr->value);
- rspamd_str_lc (hdr->value, hlen);
cd = rspamd_content_disposition_parse (hdr->value, hlen,
task->task_pool);