Skip to content

Commit 6958d7b

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 77506db commit 6958d7b

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
@@ -1911,6 +1911,9 @@ static int determine_submodule_update_strategy(struct repository *r,
19111911
const char *val;
19121912
int ret;
19131913

1914+
if (!sub)
1915+
return error(_("could not retrieve submodule information for path '%s'"), path);
1916+
19141917
key = xstrfmt("submodule.%s.update", sub->name);
19151918

19161919
if (update) {

0 commit comments

Comments
 (0)