mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-06 21:08:56 +00:00
winhttp: Prevent swallowing of url parsing error
This commit is contained in:
parent
c13b68442f
commit
f0c53d21a4
@ -1116,9 +1116,9 @@ static int winhttp_action(
|
|||||||
int ret = -1;
|
int ret = -1;
|
||||||
|
|
||||||
if (!t->connection)
|
if (!t->connection)
|
||||||
if (gitno_connection_data_from_url(&t->connection_data, url, NULL) < 0 ||
|
if ((ret = gitno_connection_data_from_url(&t->connection_data, url, NULL)) < 0 ||
|
||||||
winhttp_connect(t, url) < 0)
|
(ret = winhttp_connect(t, url)) < 0)
|
||||||
return -1;
|
return ret;
|
||||||
|
|
||||||
if (winhttp_stream_alloc(t, &s) < 0)
|
if (winhttp_stream_alloc(t, &s) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -463,3 +463,9 @@ void test_online_clone__ssh_cannot_change_username(void)
|
|||||||
|
|
||||||
cl_git_fail(git_clone(&g_repo, "ssh://git@github.com/libgit2/TestGitRepository", "./foo", &g_options));
|
cl_git_fail(git_clone(&g_repo, "ssh://git@github.com/libgit2/TestGitRepository", "./foo", &g_options));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void test_online_clone__url_with_no_path_returns_EINVALIDSPEC(void)
|
||||||
|
{
|
||||||
|
cl_git_fail_with(git_clone(&g_repo, "http://github.com", "./foo", &g_options),
|
||||||
|
GIT_EINVALIDSPEC);
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user