diff options
-rw-r--r-- | src/libutil/addr.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/libutil/addr.c b/src/libutil/addr.c index 4babfb1d2..30a9ce66a 100644 --- a/src/libutil/addr.c +++ b/src/libutil/addr.c @@ -527,6 +527,12 @@ rspamd_parse_inet_address_ip6 (const guchar *text, gsize len, gpointer target) len -= sizeof ("IPv6:") - 1; } + if (*p == '[' && len > 1 && p[len - 1] == ']') { + /* Strip [] as well */ + p ++; + len -= 2; + } + /* Ignore leading colon */ if (len > 0 && *p == ':') { p++; |