Commit 2fe887e6 by Etienne Samson Committed by Patrick Steinhardt

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
parent 96329606
......@@ -237,7 +237,7 @@ static int create_internal(git_remote **out, git_repository *repo, const char *n
goto on_error;
/* only write for non-anonymous remotes */
if (name && (error = write_add_refspec(repo, name, fetch, true)) < 0)
if (repo && name && (error = write_add_refspec(repo, name, fetch, true)) < 0)
goto on_error;
if (repo && (error = lookup_remote_prune_config(remote, config_ro, name)) < 0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment