Skip to content

Commit 24e8e35

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 86f4973 commit 24e8e35

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
@@ -1934,6 +1934,9 @@ static int determine_submodule_update_strategy(struct repository *r,
19341934
const char *val;
19351935
int ret;
19361936

1937+
if (!sub)
1938+
return error(_("could not retrieve submodule information for path '%s'"), path);
1939+
19371940
key = xstrfmt("submodule.%s.update", sub->name);
19381941

19391942
if (update) {

0 commit comments

Comments
 (0)