From ef215d6ef17e5ce23f4c7d4b625ff820c56c7de4 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Mon, 4 Jun 2012 19:22:17 +0400 Subject: [PATCH] Assume empty headers as headers with "" as value. --- src/message.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/message.c b/src/message.c index 7620eb25d..b51114fd0 100644 --- a/src/message.c +++ b/src/message.c @@ -541,7 +541,7 @@ process_raw_headers (struct worker_task *task) else { /* Process value */ l = p - c; - if (l > 0) { + if (l >= 0) { tmp = memory_pool_alloc (task->task_pool, l + 1); rspamd_strlcpy (tmp, c, l + 1); new->separator = tmp; @@ -615,6 +615,7 @@ process_raw_headers (struct worker_task *task) case 5: /* Header has only name, no value */ new->next = NULL; + new->value = ""; if ((lp = g_hash_table_lookup (task->raw_headers, new->name)) != NULL) { while (lp->next != NULL) { lp = lp->next; -- 2.39.5