mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-11 18:50:28 +09:00
Delay the check for kbdint->answers in kbdint_send()
(cherry picked from commit 32ba5204b7)
This commit is contained in:
@@ -1599,8 +1599,7 @@ static int kbdauth_send(ssh_session session) {
|
|||||||
|
|
||||||
enter_function();
|
enter_function();
|
||||||
|
|
||||||
if(session==NULL || session->kbdint == NULL
|
if(session==NULL || session->kbdint == NULL) {
|
||||||
|| session->kbdint->answers == NULL) {
|
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1612,7 +1611,7 @@ static int kbdauth_send(ssh_session session) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < session->kbdint->nprompts; i++) {
|
for (i = 0; i < session->kbdint->nprompts; i++) {
|
||||||
if (session->kbdint->answers[i]) {
|
if (session->kbdint->answers && session->kbdint->answers[i]) {
|
||||||
answer = ssh_string_from_char(session->kbdint->answers[i]);
|
answer = ssh_string_from_char(session->kbdint->answers[i]);
|
||||||
} else {
|
} else {
|
||||||
answer = ssh_string_from_char("");
|
answer = ssh_string_from_char("");
|
||||||
|
|||||||
Reference in New Issue
Block a user