From e2452cf60e53df3a1f41959914968a9afca02bab Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 16 Mar 2023 23:59:30 +0100 Subject: [PATCH] tool_getparam: error if --next is used without a prior URL MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reported-by: 積丹尼 Dan Jacobson Ref: https://github.com/curl/curl/pull/10769#discussion_r1137895629 Closes #10782 --- src/tool_getparam.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/tool_getparam.c b/src/tool_getparam.c index 17a6f5567d..6d6cac3dbd 100644 --- a/src/tool_getparam.c +++ b/src/tool_getparam.c @@ -2526,6 +2526,10 @@ ParameterError parse_args(struct GlobalConfig *global, int argc, else result = PARAM_NO_MEM; } + else { + errorf(global, "missing URL before --next\n"); + result = PARAM_BAD_USE; + } } else if(!result && passarg) i++; /* we're supposed to skip this */