From 2a5d75453b76912160c3709913de34ea1ee7534e Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Fri, 5 Sep 2014 16:15:03 +0100 Subject: [PATCH] Fix received headers parsing. --- src/libmime/message.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/libmime/message.c b/src/libmime/message.c index a1bc2d25f..fff55b4fe 100644 --- a/src/libmime/message.c +++ b/src/libmime/message.c @@ -313,10 +313,11 @@ parse_qmail_recv (rspamd_mempool_t * pool, static void parse_recv_header (rspamd_mempool_t * pool, - gchar *line, + struct raw_header *rh, struct received_header *r) { gchar *p, *s, t, **res = NULL; + gchar *line; enum { RSPAMD_RECV_STATE_INIT = 0, RSPAMD_RECV_STATE_FROM, @@ -330,6 +331,11 @@ parse_recv_header (rspamd_mempool_t * pool, next_state = RSPAMD_RECV_STATE_INIT; gboolean is_exim = FALSE; + line = rh->decoded; + if (line == NULL) { + return; + } + g_strstrip (line); p = line; s = line; -- 2.39.5