From 739d63244f84347633bb243955f094dcec4b0ab1 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Sun, 31 Jan 2016 15:53:25 +0100 Subject: [PATCH] Fix parsing of ip:port strings --- src/libutil/addr.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/libutil/addr.c b/src/libutil/addr.c index 2324096e9..7c7eac3a5 100644 --- a/src/libutil/addr.c +++ b/src/libutil/addr.c @@ -597,7 +597,9 @@ rspamd_parse_inet_address (rspamd_inet_addr_t **target, if ((end = memchr (src, ':', srclen)) != NULL) { /* This is either port number and ipv4 addr or ipv6 addr */ - if (ipv6_status == RSPAMD_IPV6_SUPPORTED && + /* Search for another semicolon */ + if (memchr (end + 1, ':', srclen - (end - src + 1)) && + ipv6_status == RSPAMD_IPV6_SUPPORTED && rspamd_parse_inet_address_ip6 (src, srclen, &su.s6.sin6_addr)) { addr = rspamd_inet_addr_create (AF_INET6); memcpy (&addr->u.in.addr.s6.sin6_addr, &su.s6.sin6_addr, -- 2.39.5