Skip to content

Commit be49bd8

Browse files
committed
submodule: check return value of submodule_from_path()
As pointed out by CodeQL, it could be NULL and we usually check for that. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 0eb8723 commit be49bd8

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

builtin/submodule--helper.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1913,6 +1913,9 @@ static int determine_submodule_update_strategy(struct repository *r,
19131913
const char *val;
19141914
int ret;
19151915

1916+
if (!sub)
1917+
return error(_("could not retrieve submodule information for path '%s'"), path);
1918+
19161919
key = xstrfmt("submodule.%s.update", sub->name);
19171920

19181921
if (update) {

0 commit comments

Comments
 (0)