summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2018-03-08 17:13:42 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2018-03-08 17:13:42 +0000
commit0398b848d4b61b90c51175c713ee3ba1c16829f2 (patch)
tree2b07627ae6ad5f4f95c98d169724495359813b90
parent7d40adf82d014bc25de73708ac5c528dc8115f90 (diff)
downloadrspamd-0398b848d4b61b90c51175c713ee3ba1c16829f2.tar.gz
rspamd-0398b848d4b61b90c51175c713ee3ba1c16829f2.zip
[Minor] Fix overwriting of lowercased content-disposition data
-rw-r--r--src/libmime/content_type.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/libmime/content_type.c b/src/libmime/content_type.c
index bcb047898..61520c425 100644
--- a/src/libmime/content_type.c
+++ b/src/libmime/content_type.c
@@ -502,13 +502,12 @@ rspamd_content_disposition_parse (const gchar *in,
{
struct rspamd_content_disposition *res = NULL, val;
- val.lc_data = rspamd_mempool_alloc (pool, len + 1);
- rspamd_strlcpy (val.lc_data, in, len);
- rspamd_str_lc (val.lc_data, len);
-
if (rspamd_content_disposition_parser (in, len, &val, pool)) {
res = rspamd_mempool_alloc (pool, sizeof (val));
memcpy (res, &val, sizeof (val));
+ res->lc_data = rspamd_mempool_alloc (pool, len + 1);
+ rspamd_strlcpy (res->lc_data, in, len);
+ rspamd_str_lc (res->lc_data, len);
}
else {
msg_warn_pool ("cannot parse content disposition: %*s",