aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/libutil/addr.c4
1 files changed, 3 insertions, 1 deletions
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,