summaryrefslogtreecommitdiff
path: root/lib/url.c
diff options
context:
space:
mode:
authorDiven Qi <diven.qi@zoom.us>2020-09-07 17:30:04 +0800
committerDaniel Stenberg <daniel@haxx.se>2020-09-08 00:48:09 +0200
commit3532262edd13e191862b55dec546a732f7d79144 (patch)
treee6677933252cf724890033c7aa0adac8aa011c0f /lib/url.c
parent6f42e3b16968efded56238b4bce91242a0c29983 (diff)
downloadcurl-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.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/url.c b/lib/url.c
index b3884572d..af2a1c06d 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -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)