From fdf7de4a1ca12bcc8be19ecfa5b6915056622231 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Fri, 22 Mar 2019 16:32:41 +0000 Subject: [PATCH] sessprep: fix detection of unbracketed IPv6 literals. The centralisation I did in commit e3796cb77 introduced a foolish sense error, in which I was supposed to be treating an unbracketed colon in CONF_hostname as separating host name from a port-number- shaped suffix if it _was_ the only one, and instead, accidentally did so if it _wasn't_. --- sessprep.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sessprep.c b/sessprep.c index 15d830d9..95e7b658 100644 --- a/sessprep.c +++ b/sessprep.c @@ -63,7 +63,7 @@ void prepare_session(Conf *conf) * _more_ than one (un-IPv6-bracketed) colon. */ p = host_strchr(host, ':'); - if (p && p != host_strrchr(host, ':')) { + if (p && p == host_strrchr(host, ':')) { *p = '\0'; }