mirror of
https://git.proxmox.com/git/libgit2
synced 2025-08-07 07:52:30 +00:00
Fix a crash if git_remote_set_cred_acquire_cb wasn't called before connecting.
Fixes #1700.
This commit is contained in:
parent
4ae29053d5
commit
219f318c05
@ -345,13 +345,15 @@ static int _git_ssh_setup_conn(
|
|||||||
if (user && pass) {
|
if (user && pass) {
|
||||||
if (git_cred_userpass_plaintext_new(&t->cred, user, pass) < 0)
|
if (git_cred_userpass_plaintext_new(&t->cred, user, pass) < 0)
|
||||||
goto on_error;
|
goto on_error;
|
||||||
} else {
|
} else if (t->owner->cred_acquire_cb) {
|
||||||
if (t->owner->cred_acquire_cb(&t->cred,
|
if (t->owner->cred_acquire_cb(&t->cred,
|
||||||
t->owner->url,
|
t->owner->url,
|
||||||
user,
|
user,
|
||||||
GIT_CREDTYPE_USERPASS_PLAINTEXT | GIT_CREDTYPE_SSH_KEYFILE_PASSPHRASE,
|
GIT_CREDTYPE_USERPASS_PLAINTEXT | GIT_CREDTYPE_SSH_KEYFILE_PASSPHRASE,
|
||||||
t->owner->cred_acquire_payload) < 0)
|
t->owner->cred_acquire_payload) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
} else {
|
||||||
|
goto on_error;
|
||||||
}
|
}
|
||||||
assert(t->cred);
|
assert(t->cred);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user