diff options
author | Diven Qi <diven.qi@zoom.us> | 2020-09-07 17:30:04 +0800 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2020-09-08 00:48:09 +0200 |
commit | 3532262edd13e191862b55dec546a732f7d79144 (patch) | |
tree | e6677933252cf724890033c7aa0adac8aa011c0f /lib/url.c | |
parent | 6f42e3b16968efded56238b4bce91242a0c29983 (diff) | |
download | curl-3532262edd13e191862b55dec546a732f7d79144.tar.gz |
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
Diffstat (limited to 'lib/url.c')
-rw-r--r-- | lib/url.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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) |