From: Vsevolod Stakhov Date: Fri, 5 Sep 2014 15:15:03 +0000 (+0100) Subject: Fix received headers parsing. X-Git-Tag: 0.7.0~28 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=2a5d75453b76912160c3709913de34ea1ee7534e;p=rspamd.git Fix received headers parsing. --- 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;