From d65646bbcacf3f7648d032597bbf00f0ef8cf1c3 Mon Sep 17 00:00:00 2001 From: djm <> Date: Wed, 8 Jun 2022 20:20:26 +0000 Subject: do not refuse valid IPv6 addresses in -X connect (HTTP CONNECT proxy) support. Identified by Wilmer van der Gaast, ok millert@ --- src/usr.bin/nc/socks.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/usr.bin/nc/socks.c b/src/usr.bin/nc/socks.c index 9766be7da4..7c7448c9c5 100644 --- a/src/usr.bin/nc/socks.c +++ b/src/usr.bin/nc/socks.c @@ -1,4 +1,4 @@ -/* $OpenBSD: socks.c,v 1.30 2019/11/04 17:33:28 millert Exp $ */ +/* $OpenBSD: socks.c,v 1.31 2022/06/08 20:20:26 djm Exp $ */ /* * Copyright (c) 1999 Niklas Hallqvist. All rights reserved. @@ -321,7 +321,7 @@ socks_connect(const char *host, const char *port, /* HTTP proxy CONNECT */ /* Disallow bad chars in hostname */ - if (strcspn(host, "\r\n\t []:") != strlen(host)) + if (strcspn(host, "\r\n\t []") != strlen(host)) errx(1, "Invalid hostname"); /* Try to be sane about numeric IPv6 addresses */ -- cgit v1.2.3-55-g6feb