From bfbacbdb444a9fdef2d0a3f7c87a9d6b12f5a2d4 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Mon, 17 Feb 2020 17:05:05 +0000 Subject: [PATCH] [CritFix] Fix parsing of the content type attributes --- src/libmime/content_type.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) 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; -- 2.39.5