From: Daniel Stenberg Date: Thu, 21 Dec 2023 08:50:00 +0000 (+0100) Subject: tool_getparam: do not try to expand without an argument X-Git-Tag: curl-8_6_0~186 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d187f5194813463b0bae4d4d5a3368e0ffcdfe54;p=thirdparty%2Fcurl.git tool_getparam: do not try to expand without an argument This would lead to a segfault. Fixes #12565 Reported-by: Geeknik Labs Closes #12575 --- diff --git a/src/tool_getparam.c b/src/tool_getparam.c index 6b256f8224..79110eb7d2 100644 --- a/src/tool_getparam.c +++ b/src/tool_getparam.c @@ -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;