socks: fix username max size is 255 (0xFF)

Closes #10105

Reviewed-by: Daniel Gustafsson
This commit is contained in:
Xì Gà 2022-12-16 17:58:38 +07:00 committed by Daniel Stenberg
parent 66f4d50fa6
commit 6cc18802f8
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -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;
}