Unverified Commit 5b08a71f by Edward Thomson Committed by GitHub

Merge pull request #4934 from stinb/proxy-crash

Fix crash on remote connection when GIT_PROXY_AUTO is set but no proxy is detected
parents 99afd41f 35d86c77
...@@ -679,6 +679,9 @@ static int load_proxy_config(http_subtransport *t) ...@@ -679,6 +679,9 @@ static int load_proxy_config(http_subtransport *t)
!!t->server.url.use_ssl, &t->proxy_url)) < 0) !!t->server.url.use_ssl, &t->proxy_url)) < 0)
return error; return error;
if (!t->proxy_url)
return 0;
t->proxy_opts.type = GIT_PROXY_SPECIFIED; t->proxy_opts.type = GIT_PROXY_SPECIFIED;
t->proxy_opts.url = t->proxy_url; t->proxy_opts.url = t->proxy_url;
t->proxy_opts.credentials = t->owner->proxy.credentials; t->proxy_opts.credentials = t->owner->proxy.credentials;
......
...@@ -840,3 +840,10 @@ void test_online_clone__proxy_credentials_in_environment(void) ...@@ -840,3 +840,10 @@ void test_online_clone__proxy_credentials_in_environment(void)
git_buf_dispose(&url); git_buf_dispose(&url);
} }
void test_online_clone__proxy_auto_not_detected(void)
{
g_options.fetch_opts.proxy_opts.type = GIT_PROXY_AUTO;
cl_git_pass(git_clone(&g_repo, "http://github.com/libgit2/TestGitRepository", "./foo", &g_options));
}
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