mirror of
https://github.com/curl/curl.git
synced 2026-05-30 07:57:27 +03:00
url: treat missing usernames in netrc as empty
- If, after parsing netrc, there is a password with no username then
set a blank username.
This used to be the case prior to 7d600ad (precedes 7.82). Note
parseurlandfillconn already does the same thing for URLs.
Reported-by: Raivis <standsed@users.noreply.github.com>
Testing-by: Domen Kožar
Fixes https://github.com/curl/curl/issues/8653
Closes #9334
Closes #9066
This commit is contained in:
parent
2fc031d834
commit
8bd03516d6
1 changed files with 6 additions and 0 deletions
|
|
@ -3050,6 +3050,12 @@ static CURLcode override_login(struct Curl_easy *data,
|
|||
/* don't update the user name below */
|
||||
userp = NULL;
|
||||
}
|
||||
/* no user was set but a password, set a blank user */
|
||||
if(userp && !*userp && *passwdp) {
|
||||
*userp = strdup("");
|
||||
if(!*userp)
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue