From: Vsevolod Stakhov Date: Thu, 17 Sep 2015 13:41:49 +0000 (+0100) Subject: Sanitize spaces in headers' start. X-Git-Tag: 1.0.0~9 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=ce3ecc6d36e9c235538cb41cbedeb7b5d154257f;p=rspamd.git Sanitize spaces in headers' start. --- diff --git a/src/libmime/message.c b/src/libmime/message.c index c9ffc5aac..54c5ab59e 100644 --- a/src/libmime/message.c +++ b/src/libmime/message.c @@ -528,6 +528,11 @@ process_raw_headers (struct rspamd_task *task, GHashTable *target, } *tp = '\0'; + /* Strip the initial spaces that could also be added by folding */ + while (*tmp != '\0' && g_ascii_isspace (*tmp)) { + tmp ++; + } + new->value = tmp; new->decoded = g_mime_utils_header_decode_text (new->value); rspamd_mempool_add_destructor (task->task_pool,