From 6cc18802f87fa8e86d27ebf9db32bf3a4ec184a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?X=C3=AC=20G=C3=A0?= Date: Fri, 16 Dec 2022 17:58:38 +0700 Subject: [PATCH] socks: fix username max size is 255 (0xFF) Closes #10105 Reviewed-by: Daniel Gustafsson --- lib/socks.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/socks.c b/lib/socks.c index 1b9f4fde7d..d491e089be 100644 --- a/lib/socks.c +++ b/lib/socks.c @@ -690,7 +690,7 @@ static CURLproxycode do_SOCKS5(struct Curl_cfilter *cf, socksreq[len++] = (unsigned char) proxy_user_len; if(sx->proxy_user && proxy_user_len) { /* the length must fit in a single byte */ - if(proxy_user_len >= 255) { + if(proxy_user_len > 255) { failf(data, "Excessive user name length for proxy auth"); return CURLPX_LONG_USER; }