mirror of
https://github.com/curl/curl.git
synced 2026-04-21 04:02:12 +03:00
tool_getparam: clear argument only when needed
Test 699 verifies Reported-by: bsr13 on hackerone Closes #17112
This commit is contained in:
parent
929c9a7ef7
commit
da9494eef0
3 changed files with 62 additions and 4 deletions
|
|
@ -1785,7 +1785,8 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */
|
|||
nextarg = &parse[1]; /* this is the actual extra parameter */
|
||||
singleopt = TRUE; /* do not loop anymore after this */
|
||||
#ifdef HAVE_WRITABLE_ARGV
|
||||
clearthis = &cleararg1[parse + 2 - flag];
|
||||
if(cleararg1)
|
||||
clearthis = &cleararg1[parse + 2 - flag];
|
||||
#endif
|
||||
}
|
||||
else if(!nextarg) {
|
||||
|
|
@ -1794,7 +1795,8 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */
|
|||
}
|
||||
else {
|
||||
#ifdef HAVE_WRITABLE_ARGV
|
||||
clearthis = cleararg2;
|
||||
if(cleararg2)
|
||||
clearthis = cleararg2;
|
||||
#endif
|
||||
*usedarg = TRUE; /* mark it as used */
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue