]> source.dussan.org Git - rspamd.git/commitdiff
Fix parsing of ip:port strings
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Sun, 31 Jan 2016 14:53:25 +0000 (15:53 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Sun, 31 Jan 2016 14:53:25 +0000 (15:53 +0100)
src/libutil/addr.c

index 2324096e964a6b34738e71ba68adabc7473b00ff..7c7eac3a588939a581dd9ab0a6d920cf8a07d9f7 100644 (file)
@@ -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,