diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-04-08 13:55:09 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-04-08 13:55:09 +0100 |
commit | fe8028c1083719f2597e015f16e1d24a4847244c (patch) | |
tree | 80552c866eba24a44fd92cd0f3a256cf2c21006c /src/libmime/mime_parser.c | |
parent | e8f8cc343f2d32cbbeeb9fbd95d8bb394a1504e6 (diff) | |
download | rspamd-fe8028c1083719f2597e015f16e1d24a4847244c.tar.gz rspamd-fe8028c1083719f2597e015f16e1d24a4847244c.zip |
[Minor] Strip some bad characters from CTE headers
Diffstat (limited to 'src/libmime/mime_parser.c')
-rw-r--r-- | src/libmime/mime_parser.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/libmime/mime_parser.c b/src/libmime/mime_parser.c index dc55efe20..6572f4e88 100644 --- a/src/libmime/mime_parser.c +++ b/src/libmime/mime_parser.c @@ -148,10 +148,13 @@ rspamd_mime_parser_init_lib (void) static enum rspamd_cte rspamd_mime_parse_cte (const gchar *in, gsize len) { - guint64 h = rspamd_cryptobox_fast_hash_specific (RSPAMD_CRYPTOBOX_XXHASH64, - in, len, 0xdeadbabe); + guint64 h; enum rspamd_cte ret = RSPAMD_CTE_UNKNOWN; + in = rspamd_string_len_strip (in, &len, " \t;,.+-#!`~'"); + h = rspamd_cryptobox_fast_hash_specific (RSPAMD_CRYPTOBOX_XXHASH64, + in, len, 0xdeadbabe); + switch (h) { case 0xCEDAA7056B4753F7ULL: /* 7bit */ ret = RSPAMD_CTE_7BIT; |