mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-24 05:21:25 +00:00
Bail out if remote->url would be NULL
This fixes a crash from attempting to invoke git__strdup() against NULL.
This commit is contained in:
parent
1e99ce9ac7
commit
83885891f5
@ -131,6 +131,11 @@ int git_remote_load(git_remote **out, git_repository *repo, const char *name)
|
|||||||
|
|
||||||
if ((error = git_config_get_string(&val, config, git_buf_cstr(&buf))) < 0)
|
if ((error = git_config_get_string(&val, config, git_buf_cstr(&buf))) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
|
if (!val) {
|
||||||
|
error = -1;
|
||||||
|
goto cleanup;
|
||||||
|
}
|
||||||
|
|
||||||
remote->repo = repo;
|
remote->repo = repo;
|
||||||
remote->url = git__strdup(val);
|
remote->url = git__strdup(val);
|
||||||
|
Loading…
Reference in New Issue
Block a user