Skip to content

Commit fbdf66e

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 <johannes.schindelin@gmx.de>
1 parent 4fe23c9 commit fbdf66e

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
@@ -1907,6 +1907,9 @@ static int determine_submodule_update_strategy(struct repository *r,
19071907
const char *val;
19081908
int ret;
19091909

1910+
if (!sub)
1911+
return error(_("could not retrieve submodule information for path '%s'"), path);
1912+
19101913
key = xstrfmt("submodule.%s.update", sub->name);
19111914

19121915
if (update) {

0 commit comments

Comments
 (0)