From 17f7f508143656b5ffda630e18156fbc37c3b445 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Mon, 6 Aug 2018 14:26:45 +0930 Subject: [PATCH] wireaddr: correctly parse ':portnum' (meaning IPv4 and IPv6) Signed-off-by: Rusty Russell --- common/wireaddr.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/common/wireaddr.c b/common/wireaddr.c index 86f1b35ac..8f2f2819b 100644 --- a/common/wireaddr.c +++ b/common/wireaddr.c @@ -268,9 +268,8 @@ static bool separate_address_and_port(const tal_t *ctx, const char *arg, portcolon = strchr(arg, ':'); if (portcolon) { /* Disregard if there's more than one : or if it's at - the start or end */ + the end */ if (portcolon != strrchr(arg, ':') - || portcolon == arg || portcolon[1] == '\0') portcolon = NULL; }