mirror of
https://github.com/curl/curl.git
synced 2026-08-06 01:26:14 +03:00
netrc: 'default' with no credentials is not a match
Test 486 verifies. Reported-by: Yihang Zhou Closes #15908
This commit is contained in:
parent
abf8062449
commit
0e120c5b92
3 changed files with 116 additions and 6 deletions
15
lib/netrc.c
15
lib/netrc.c
|
|
@ -316,11 +316,16 @@ static int parsenetrc(struct store_netrc *store,
|
|||
|
||||
out:
|
||||
Curl_dyn_free(&token);
|
||||
if(!retcode && !password && our_login) {
|
||||
/* success without a password, set a blank one */
|
||||
password = strdup("");
|
||||
if(!password)
|
||||
retcode = 1; /* out of memory */
|
||||
if(!retcode) {
|
||||
if(!password && our_login) {
|
||||
/* success without a password, set a blank one */
|
||||
password = strdup("");
|
||||
if(!password)
|
||||
retcode = 1; /* out of memory */
|
||||
}
|
||||
else if(!login && !password)
|
||||
/* a default with no credentials */
|
||||
retcode = NETRC_FILE_MISSING;
|
||||
}
|
||||
if(!retcode) {
|
||||
/* success */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue