aboutsummaryrefslogtreecommitdiffstats
path: root/src/libmime/content_type.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2017-07-13 19:33:42 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2017-07-13 19:33:42 +0100
commit2d12e77123ab3ca9ba5085c7718a6ac8a3d8a2c2 (patch)
tree7d396e181661b175a96fa89f2610d47a544462da /src/libmime/content_type.c
parentb93f976e37deaa545765cf0a935758eb630c3c45 (diff)
downloadrspamd-2d12e77123ab3ca9ba5085c7718a6ac8a3d8a2c2.tar.gz
rspamd-2d12e77123ab3ca9ba5085c7718a6ac8a3d8a2c2.zip
[CritFix] Fix semicolons parsing in the content type
Diffstat (limited to 'src/libmime/content_type.c')
-rw-r--r--src/libmime/content_type.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/libmime/content_type.c b/src/libmime/content_type.c
index 9e132253a..240e2fab5 100644
--- a/src/libmime/content_type.c
+++ b/src/libmime/content_type.c
@@ -218,7 +218,20 @@ rspamd_content_type_parser (const gchar *in, gsize len, rspamd_mempool_t *pool)
next_state = parse_param_name;
pname_start = NULL;
pname_end = NULL;
- } else {
+ }
+ else if (*p == ';') {
+ if (pname_start && pname_end && pname_end > pname_start) {
+ rspamd_content_type_add_param (pool, &val, pname_start,
+ pname_end, c, p);
+ }
+
+ p ++;
+ state = parse_space;
+ next_state = parse_param_name;
+ pname_start = NULL;
+ pname_end = NULL;
+ }
+ else {
p++;
}
break;
@@ -311,6 +324,10 @@ rspamd_content_type_parser (const gchar *in, gsize len, rspamd_mempool_t *pool)
break;
case parse_param_value:
if (pname_start && pname_end && pname_end > pname_start) {
+ if (p > c && *(p - 1) == ';') {
+ p --;
+ }
+
rspamd_content_type_add_param (pool, &val, pname_start,
pname_end, c, p);