aboutsummaryrefslogtreecommitdiffstats
path: root/src/libmime
diff options
context:
space:
mode:
Diffstat (limited to 'src/libmime')
-rw-r--r--src/libmime/content_type.c8
-rw-r--r--src/libmime/mime_headers.c4
2 files changed, 9 insertions, 3 deletions
diff --git a/src/libmime/content_type.c b/src/libmime/content_type.c
index 4aa72cc7d..88102ad2c 100644
--- a/src/libmime/content_type.c
+++ b/src/libmime/content_type.c
@@ -228,9 +228,11 @@ rspamd_postprocess_ct_attributes (rspamd_mempool_t *pool,
gboolean invalid_utf = FALSE;
- param->value.begin = rspamd_mime_header_decode (pool, param->value.begin,
- param->value.len, &invalid_utf);
- param->value.len = strlen (param->value.begin);
+ if (param->value.begin != NULL && param->value.len > 0) {
+ param->value.begin = rspamd_mime_header_decode(pool, param->value.begin,
+ param->value.len, &invalid_utf);
+ param->value.len = strlen(param->value.begin);
+ }
if (invalid_utf) {
param->flags |= RSPAMD_CONTENT_PARAM_BROKEN;
diff --git a/src/libmime/mime_headers.c b/src/libmime/mime_headers.c
index 4d2c89dae..9dc336cf7 100644
--- a/src/libmime/mime_headers.c
+++ b/src/libmime/mime_headers.c
@@ -1911,6 +1911,10 @@ rspamd_message_set_modified_header (struct rspamd_task *task,
raw_value = ucl_object_tolstring (value, &raw_len);
+ if (raw_len == 0) {
+ continue;
+ }
+
struct rspamd_mime_header *nhdr = rspamd_mempool_alloc0 (
task->task_pool, sizeof (*nhdr));