mirror of
https://github.com/curl/curl.git
synced 2026-08-24 20:23:40 +03:00
setopt: clear proxy auth properly on NULL
Verify NULLed proxy credentials with test1648 Closes #21696
This commit is contained in:
parent
f902c3c486
commit
88c7e16cce
5 changed files with 206 additions and 8 deletions
12
lib/setopt.c
12
lib/setopt.c
|
|
@ -1661,16 +1661,16 @@ static CURLcode setopt_cptr_proxy(struct Curl_easy *data, CURLoption option,
|
|||
result = setstropt_userpwd(ptr, &u, &p);
|
||||
|
||||
/* URL decode the components */
|
||||
if(!result && u) {
|
||||
if(!result) {
|
||||
curlx_safefree(s->str[STRING_PROXYUSERNAME]);
|
||||
result = Curl_urldecode(u, 0, &s->str[STRING_PROXYUSERNAME], NULL,
|
||||
REJECT_ZERO);
|
||||
}
|
||||
if(!result && p) {
|
||||
curlx_safefree(s->str[STRING_PROXYPASSWORD]);
|
||||
if(u)
|
||||
result = Curl_urldecode(u, 0, &s->str[STRING_PROXYUSERNAME], NULL,
|
||||
REJECT_ZERO);
|
||||
}
|
||||
if(!result && p)
|
||||
result = Curl_urldecode(p, 0, &s->str[STRING_PROXYPASSWORD], NULL,
|
||||
REJECT_ZERO);
|
||||
}
|
||||
curlx_free(u);
|
||||
curlx_free(p);
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue