]> source.dussan.org Git - rspamd.git/commitdiff
[CritFix] Fix parsing of the content type attributes
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 17 Feb 2020 17:05:05 +0000 (17:05 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 17 Feb 2020 17:05:05 +0000 (17:05 +0000)
src/libmime/content_type.c

index 887800a3feb93fef528bce23634ebd2a9880d052..3de9bdb1253b11cfba54b81204e7b8e57f8ce6c2 100644 (file)
@@ -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;