aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2020-10-08 13:21:27 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2020-10-08 13:21:27 +0100
commitdef2916b44a2c314d270378298b4e8b052417c97 (patch)
tree9616e5864671439545ca55c961ea0d29273040c0
parentda8eb274dcc06621f27154ce3aaaba55deaf812a (diff)
downloadrspamd-def2916b44a2c314d270378298b4e8b052417c97.tar.gz
rspamd-def2916b44a2c314d270378298b4e8b052417c97.zip
[Minor] Add case sensivity for file names in case of CT attribute
-rw-r--r--src/libmime/content_type.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/libmime/content_type.c b/src/libmime/content_type.c
index 1540e6b23..0c06f51fb 100644
--- a/src/libmime/content_type.c
+++ b/src/libmime/content_type.c
@@ -242,7 +242,7 @@ rspamd_content_type_postprocess (rspamd_mempool_t *pool,
RSPAMD_FTOK_ASSIGN (&srch, "charset");
- if (rspamd_ftok_casecmp (&param->name, &srch) == 0) {
+ if (rspamd_ftok_icase_equal (&param->name, &srch)) {
/* Adjust charset */
found = param;
ct->charset.begin = param->value.begin;
@@ -251,7 +251,7 @@ rspamd_content_type_postprocess (rspamd_mempool_t *pool,
RSPAMD_FTOK_ASSIGN (&srch, "boundary");
- if (rspamd_ftok_casecmp (&param->name, &srch) == 0) {
+ if (rspamd_ftok_icase_equal (&param->name, &srch)) {
found = param;
gchar *lc_boundary;
/* Adjust boundary */
@@ -266,8 +266,11 @@ rspamd_content_type_postprocess (rspamd_mempool_t *pool,
}
if (!found) {
- /* Just lowercase */
- rspamd_str_lc ((gchar *)param->value.begin, param->value.len);
+ RSPAMD_FTOK_ASSIGN (&srch, "name");
+ if (!rspamd_ftok_icase_equal (&param->name, &srch)) {
+ /* Just lowercase */
+ rspamd_str_lc ((gchar *) param->value.begin, param->value.len);
+ }
}
}
@@ -282,7 +285,7 @@ rspamd_content_disposition_postprocess (rspamd_mempool_t *pool,
srch.begin = "filename";
srch.len = 8;
- if (rspamd_ftok_casecmp (&param->name, &srch) == 0) {
+ if (rspamd_ftok_icase_equal (&param->name, &srch)) {
/* Adjust filename */
cd->filename.begin = param->value.begin;
cd->filename.len = param->value.len;