From d187f5194813463b0bae4d4d5a3368e0ffcdfe54 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 21 Dec 2023 09:50:00 +0100 Subject: [PATCH] tool_getparam: do not try to expand without an argument This would lead to a segfault. Fixes #12565 Reported-by: Geeknik Labs Closes #12575 --- src/tool_getparam.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- 2.47.3