tool_getparam: clear sensitive arguments better

curl attempts to clear some flags to hide them from snooping neighbors
(on platforms where it works). For example the credentials provided with
-u. Previously it would only do that if there was a space between the
option and the credentials as in "-u joe:s3cr3t" but not when done
without a separating space as in "-ujoe:s3cr3t".

This addresses that previous shortcoming.

Reported-by: kayrus on github
Fixes #16396
Closes #16401
This commit is contained in:
Daniel Stenberg 2025-02-19 23:55:31 +01:00
parent c64304e111
commit 654f8cb5f3
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
3 changed files with 16 additions and 8 deletions

View file

@ -361,7 +361,8 @@ const struct LongShort *findlongopt(const char *opt);
const struct LongShort *findshortopt(char letter);
ParameterError getparameter(const char *flag, char *nextarg,
argv_item_t cleararg,
argv_item_t cleararg1,
argv_item_t cleararg2,
bool *usedarg,
struct GlobalConfig *global,
struct OperationConfig *operation);