summaryrefslogtreecommitdiffstats
path: root/src/libmime/mime_headers.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2016-12-20 12:59:35 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2016-12-20 13:00:11 +0000
commit85370a6ce83c9bdf861d3377721952f5fbf8b8cd (patch)
tree36b31ba4c891ca426d04e591aa95fecbf113544b /src/libmime/mime_headers.c
parent5c62c0da6a5af93a3a533aaa543b27d2668e8697 (diff)
downloadrspamd-85370a6ce83c9bdf861d3377721952f5fbf8b8cd.tar.gz
rspamd-85370a6ce83c9bdf861d3377721952f5fbf8b8cd.zip
[Fix] Fix work with broken utf8 tokens
Diffstat (limited to 'src/libmime/mime_headers.c')
-rw-r--r--src/libmime/mime_headers.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/libmime/mime_headers.c b/src/libmime/mime_headers.c
index 27c427ae5..31a05c281 100644
--- a/src/libmime/mime_headers.c
+++ b/src/libmime/mime_headers.c
@@ -411,6 +411,11 @@ rspamd_mime_header_decode (rspamd_mempool_t *pool, const gchar *in,
&tok_start, &tok_len)) {
/* We have a token, so we can decode it from `encoding` */
if (token->len > 0) {
+ if (old_charset.len == 0) {
+ memcpy (&old_charset, &cur_charset,
+ sizeof (old_charset));
+ }
+
rspamd_mime_header_maybe_save_token (pool, out,
token, decoded,
&old_charset, &cur_charset);