From: Vsevolod Stakhov Date: Mon, 17 Feb 2020 17:05:05 +0000 (+0000) Subject: [CritFix] Fix parsing of the content type attributes X-Git-Tag: 2.4~44 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=bfbacbdb444a9fdef2d0a3f7c87a9d6b12f5a2d4;p=rspamd.git [CritFix] Fix parsing of the content type attributes --- diff --git a/src/libmime/content_type.c b/src/libmime/content_type.c index 887800a3f..3de9bdb12 100644 --- a/src/libmime/content_type.c +++ b/src/libmime/content_type.c @@ -501,6 +501,25 @@ rspamd_content_type_parser (gchar *in, gsize len, rspamd_mempool_t *pool) pname_end, c, c + qlen); } + if (*p == '"') { + p ++; + + if (p == end) { + /* Last quote: done... */ + break; + } + + if (*p == ';') { + p ++; + state = parse_space; + next_state = parse_param_name; + pname_start = NULL; + pname_end = NULL; + continue; + } + } + + /* We should not normally be here in fact */ if (g_ascii_isspace (*p)) { state = parse_space; next_state = parse_param_name;