Skip to content

Commit 08e0970

Browse files
jacob-kellergitster
authored andcommitted
submodule: check argc count for git submodule--helper clone
Extra unused arguments to git submodule--helper clone subcommand were being silently ignored. Add a check to the argc count after options handling to ensure that no extra arguments were left on the argv array. Signed-off-by: Jacob Keller <jacob.keller@gmail.com> Reviewed-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent d10e3b4 commit 08e0970

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

builtin/submodule--helper.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,10 @@ static int module_clone(int argc, const char **argv, const char *prefix)
194194
argc = parse_options(argc, argv, prefix, module_clone_options,
195195
git_submodule_helper_usage, 0);
196196

197+
if (argc)
198+
usage_with_options(git_submodule_helper_usage,
199+
module_clone_options);
200+
197201
strbuf_addf(&sb, "%s/modules/%s", get_git_dir(), name);
198202
sm_gitdir = strbuf_detach(&sb, NULL);
199203

0 commit comments

Comments
 (0)