mirror of
https://github.com/curl/curl.git
synced 2026-08-24 22:23:58 +03:00
netrc: skip malformed macdef lines
When skipping macdef lines inside netrc files, ignore it completely and
do not tokenize or bail out on bad quotes.
Verify in test 1672
Follow-up to 3b43a05e00
Spotted by Codex Security
Closes #21049
This commit is contained in:
parent
6026d76fdf
commit
fa13f373b2
3 changed files with 59 additions and 1 deletions
|
|
@ -195,6 +195,9 @@ static NETRCcode netrc_get_token(const char **tokp,
|
|||
if(*statep == MACDEF) {
|
||||
if((*tok == '\n') || (*tok == '\r'))
|
||||
*statep = NOTHING; /* end of macro definition */
|
||||
*lineend = TRUE;
|
||||
*tokp = tok;
|
||||
return NETRC_OK;
|
||||
}
|
||||
|
||||
if(!*tok || (*tok == '\n')) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue