From: Daniel Stenberg Date: Fri, 23 Jan 2004 08:29:56 +0000 (+0000) Subject: check the arguments to the socks5 function, as the name and password might X-Git-Tag: curl-7_11_1~516 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4120b7b0c0f37f6227a1cfc1373ec550ef47f6b2;p=thirdparty%2Fcurl.git check the arguments to the socks5 function, as the name and password might be NULL pointers, and if non-NULL if now support zero-length names/passwords --- diff --git a/lib/url.c b/lib/url.c index e85af3a1ae..d31417b0a8 100644 --- a/lib/url.c +++ b/lib/url.c @@ -1590,7 +1590,7 @@ static int handleSock5Proxy(const char *proxy_name, Curl_nonblock(sock, FALSE); socksreq[0] = 5; /* version */ - socksreq[1] = (char)(proxy_name[0] ? 2 : 1); /* number of methods (below) */ + socksreq[1] = (char)(proxy_name ? 2 : 1); /* number of methods (below) */ socksreq[2] = 0; /* no authentication */ socksreq[3] = 2; /* username/password */ @@ -1620,7 +1620,7 @@ static int handleSock5Proxy(const char *proxy_name, int userlen, pwlen, len; userlen = strlen(proxy_name); - pwlen = strlen(proxy_password); + pwlen = proxy_password?strlen(proxy_password):0; /* username/password request looks like * +----+------+----------+------+----------+