mirror of
https://git.proxmox.com/git/libgit2
synced 2025-08-06 07:00:27 +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,14 +345,16 @@ static int _git_ssh_setup_conn(
|
||||
if (user && pass) {
|
||||
if (git_cred_userpass_plaintext_new(&t->cred, user, pass) < 0)
|
||||
goto on_error;
|
||||
} else {
|
||||
} else if (t->owner->cred_acquire_cb) {
|
||||
if (t->owner->cred_acquire_cb(&t->cred,
|
||||
t->owner->url,
|
||||
user,
|
||||
GIT_CREDTYPE_USERPASS_PLAINTEXT | GIT_CREDTYPE_SSH_KEYFILE_PASSPHRASE,
|
||||
t->owner->cred_acquire_payload) < 0)
|
||||
return -1;
|
||||
}
|
||||
} else {
|
||||
goto on_error;
|
||||
}
|
||||
assert(t->cred);
|
||||
|
||||
if (!user) {
|
||||
|
Loading…
Reference in New Issue
Block a user