http: fix proxy auth with blank password

Regression in 7.71.0

Added test case 346 to verify.

Reported-by: Kristoffer Gleditsch
Fixes #5613
Closes #5616
This commit is contained in:
Daniel Stenberg 2020-06-26 14:16:21 +02:00
parent fc3cba22c7
commit ff43fb6dec
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
3 changed files with 62 additions and 2 deletions

View file

@ -308,7 +308,7 @@ static CURLcode http_output_basic(struct connectdata *conn, bool proxy)
pwd = conn->passwd;
}
out = aprintf("%s:%s", user, pwd);
out = aprintf("%s:%s", user, pwd ? pwd : "");
if(!out)
return CURLE_OUT_OF_MEMORY;