Skip to content

Commit 9a237b7

Browse files
jacob-kellerdscho
authored andcommitted
submodule: fix segmentation fault in submodule--helper clone
The git submodule--helper clone command will fail with a segmentation fault when given a null url or null path variable. Since these are required for proper functioning of the submodule--helper clone subcommand, add checks to prevent running and fail gracefully when missing. Update the usage string to reflect the requirement that the --url and --path "options" are required. Signed-off-by: Jacob Keller <[email protected]> Reviewed-by: Stefan Beller <[email protected]> Signed-off-by: Junio C Hamano <[email protected]> Signed-off-by: Johannes Schindelin <[email protected]>
1 parent a7e2546 commit 9a237b7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

builtin/submodule--helper.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,7 @@ static int module_clone(int argc, const char **argv, const char *prefix)
515515
usage_with_options(git_submodule_helper_usage,
516516
module_clone_options);
517517

518-
if (argc)
518+
if (argc || !url)
519519
usage_with_options(git_submodule_helper_usage,
520520
module_clone_options);
521521

0 commit comments

Comments
 (0)