Skip to content

Commit e5449c5

Browse files
dschogitster
authored andcommitted
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]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent b1f4a09 commit e5449c5

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)