Skip to content

Commit df4937b

Browse files
committed
remote: repo is optional here
As per CID:1378747, we might be called with a NULL repo, which would be deferenced in write_add_refspec
1 parent 8122ef9 commit df4937b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/remote.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ static int create_internal(git_remote **out, git_repository *repo, const char *n
237237
goto on_error;
238238

239239
/* only write for non-anonymous remotes */
240-
if (name && (error = write_add_refspec(repo, name, fetch, true)) < 0)
240+
if (repo && name && (error = write_add_refspec(repo, name, fetch, true)) < 0)
241241
goto on_error;
242242

243243
if (repo && (error = lookup_remote_prune_config(remote, config_ro, name)) < 0)

0 commit comments

Comments
 (0)