aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormilo <milo@r0ot.me>2011-05-02 18:02:56 +0200
committermilo <milo@r0ot.me>2011-05-02 18:04:56 +0200
commitf503c4a3e171539331b792e0c46caa28e7a679a0 (patch)
treef4245827ce25e3eb3958409064dcf236084db34a
parenta56c925da9be128e6c29c2dd7a6031366d6370eb (diff)
downloadlibssh-f503c4a3e171539331b792e0c46caa28e7a679a0.tar.gz
libssh-f503c4a3e171539331b792e0c46caa28e7a679a0.tar.xz
libssh-f503c4a3e171539331b792e0c46caa28e7a679a0.zip
Delay the check for kbdint->answers in kbdint_send()
(cherry picked from commit 32ba5204b77906efa5613863c34fa916e7a83217)
-rw-r--r--src/auth.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/auth.c b/src/auth.c
index 8d795a46..32a708f7 100644
--- a/src/auth.c
+++ b/src/auth.c
@@ -1599,8 +1599,7 @@ static int kbdauth_send(ssh_session session) {
enter_function();
- if(session==NULL || session->kbdint == NULL
- || session->kbdint->answers == NULL) {
+ if(session==NULL || session->kbdint == NULL) {
return rc;
}
@@ -1612,7 +1611,7 @@ static int kbdauth_send(ssh_session session) {
}
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]);
} else {
answer = ssh_string_from_char("");