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;
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));