summaryrefslogtreecommitdiff
path: root/src/remote.c
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2012-11-05 11:06:50 -0800
committerRussell Belfer <rb@github.com>2012-11-05 11:06:50 -0800
commita5e85d86b7e13352c553b0a43bc36fee5880b5c7 (patch)
tree264d493b64cf5cc7b0ae3b411bcbc270ed4ab344 /src/remote.c
parent065be7a1d9779d72d7de5e9f963f7b6dc971e66e (diff)
parentc1cd036e409b874932f3da83624809e0a9bc9b47 (diff)
downloadlibgit2-a5e85d86b7e13352c553b0a43bc36fee5880b5c7.tar.gz
Merge pull request #1046 from libgit2/empty-remote-url-crash
Bail out of remote loading if the URL would be NULL
Diffstat (limited to 'src/remote.c')
-rw-r--r--src/remote.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/remote.c b/src/remote.c
index 47bcaf95f..a873a27b6 100644
--- a/src/remote.c
+++ b/src/remote.c
@@ -131,6 +131,12 @@ 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)
goto cleanup;
+
+ if (!val) {
+ giterr_set(GITERR_INVALID, "Malformed remote '%s' - missing URL", name);
+ error = -1;
+ goto cleanup;
+ }
remote->repo = repo;
remote->url = git__strdup(val);