summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/libutil/addr.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/libutil/addr.c b/src/libutil/addr.c
index 15480a9ad..03e7e9918 100644
--- a/src/libutil/addr.c
+++ b/src/libutil/addr.c
@@ -1440,8 +1440,18 @@ rspamd_parse_host_port_priority (const gchar *str,
portbuf, 0, pool);
}
else {
+ const gchar *second_semicolon = strchr (p + 1, ':');
+
name = str;
- namelen = p - str;
+
+ if (second_semicolon) {
+ /* name + port part excluding priority */
+ namelen = second_semicolon - str;
+ }
+ else {
+ /* Full ip/name + port */
+ namelen = strlen (str);
+ }
if (!rspamd_check_port_priority (p, default_port, priority, portbuf,
sizeof (portbuf), pool)) {