url: use blank credentials when using proxy w/o username and password

Fixes proxy regression brought in commit ad829b21ae (7.71.0)

Fixed #5911
Closes #5914
This commit is contained in:
Diven Qi 2020-09-07 17:30:04 +08:00 committed by Daniel Stenberg
parent 6f42e3b169
commit 3532262edd
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -2379,8 +2379,10 @@ static CURLcode parse_proxy(struct Curl_easy *data,
static CURLcode parse_proxy_auth(struct Curl_easy *data,
struct connectdata *conn)
{
char *proxyuser = data->set.str[STRING_PROXYUSERNAME];
char *proxypasswd = data->set.str[STRING_PROXYPASSWORD];
const char *proxyuser = data->set.str[STRING_PROXYUSERNAME] ?
data->set.str[STRING_PROXYUSERNAME] : "";
const char *proxypasswd = data->set.str[STRING_PROXYPASSWORD] ?
data->set.str[STRING_PROXYPASSWORD] : "";
CURLcode result = CURLE_OK;
if(proxyuser)