tool_getparam: do not try to expand without an argument

This would lead to a segfault.

Fixes #12565
Reported-by: Geeknik Labs
Closes #12575
This commit is contained in:
Daniel Stenberg 2023-12-21 09:50:00 +01:00
parent 000c738140
commit d187f51948
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -822,7 +822,7 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */
err = PARAM_NO_NOT_BOOLEAN;
goto error;
}
else if(expand) {
else if(expand && nextarg) {
struct curlx_dynbuf nbuf;
bool replaced;