diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-05-24 16:53:13 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-05-24 16:53:13 +0100 |
commit | 75873dc4fd1085cc4863733ae1b28f94b64dc34d (patch) | |
tree | cbdb5fa8ccc2c20c372fa2da380214a93daa074f /src/libmime | |
parent | 1d4438c0596db12c250030397f1c9a9557071d0d (diff) | |
download | rspamd-75873dc4fd1085cc4863733ae1b28f94b64dc34d.tar.gz rspamd-75873dc4fd1085cc4863733ae1b28f94b64dc34d.zip |
Skip spaces at the beginning of mime message.
Diffstat (limited to 'src/libmime')
-rw-r--r-- | src/libmime/message.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/libmime/message.c b/src/libmime/message.c index 6b83f8ba4..0b2f6c08a 100644 --- a/src/libmime/message.c +++ b/src/libmime/message.c @@ -1556,8 +1556,16 @@ process_message (struct rspamd_task *task) gint rc, state = 0; tmp = rspamd_mempool_alloc (task->task_pool, sizeof (GByteArray)); - tmp->data = (guint8 *)task->msg.start; - tmp->len = task->msg.len; + p = task->msg.start; + len = task->msg.len; + /* Skip any space characters to avoid some bad messages to be unparsed */ + while (g_ascii_isspace (*p) && len > 0) { + p ++; + len --; + } + + tmp->data = (guint8 *)p; + tmp->len = len; stream = g_mime_stream_mem_new_with_byte_array (tmp); /* |