From: Vsevolod Stakhov Date: Mon, 24 Jun 2013 15:36:27 +0000 (+0100) Subject: Handle another case in received parser. X-Git-Tag: 0.6.0~277 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3a10ad76f96f5acc5533bd5523a70e67f6d7c2b6;p=thirdparty%2Frspamd.git Handle another case in received parser. --- diff --git a/src/message.c b/src/message.c index 654331a70f..33141401a0 100644 --- a/src/message.c +++ b/src/message.c @@ -470,15 +470,21 @@ parse_recv_header (memory_pool_t * pool, gchar *line, struct received_header *r) /* Got by word */ case RSPAMD_RECV_STATE_BY_BLOCK: /* Here can be only hostname */ - if (g_ascii_isalnum (*p) || *p == '.' || *p == '-' || *p == '_') { + if ((g_ascii_isalnum (*p) || *p == '.' || *p == '-' + || *p == '_') && p[1] != '\0') { p++; } else { /* We got something like hostname */ - t = *p; - *p = '\0'; - r->by_hostname = memory_pool_strdup (pool, s); - *p = t; + if (p[1] != '\0') { + t = *p; + *p = '\0'; + r->by_hostname = memory_pool_strdup (pool, s); + *p = t; + } + else { + r->by_hostname = memory_pool_strdup (pool, s); + } /* Now end of parsing */ if (is_exim) { if (r->real_ip == NULL && r->from_ip != NULL) {