summaryrefslogtreecommitdiffstats
path: root/src/auth.c
diff options
context:
space:
mode:
authormilo <milo@r0ot.me>2011-05-02 17:30:43 +0200
committermilo <milo@r0ot.me>2011-05-02 17:47:00 +0200
commita56c925da9be128e6c29c2dd7a6031366d6370eb (patch)
treef1e187bf56b5540bbad9227b39d4ff41c58d49f3 /src/auth.c
parent833cc00014f35d4c0fcf7086529a84f2500947b1 (diff)
downloadlibssh-a56c925da9be128e6c29c2dd7a6031366d6370eb.tar.gz
libssh-a56c925da9be128e6c29c2dd7a6031366d6370eb.tar.xz
libssh-a56c925da9be128e6c29c2dd7a6031366d6370eb.zip
Fix segfault when ssh_userauth_kbdint_setanswer() has not been called
(cherry picked from commit b6e712e934a45981b3a12cb67b48df006402a4d7)
Diffstat (limited to 'src/auth.c')
-rw-r--r--src/auth.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/auth.c b/src/auth.c
index bed48c23..8d795a46 100644
--- a/src/auth.c
+++ b/src/auth.c
@@ -1599,6 +1599,11 @@ static int kbdauth_send(ssh_session session) {
enter_function();
+ if(session==NULL || session->kbdint == NULL
+ || session->kbdint->answers == NULL) {
+ return rc;
+ }
+
if (buffer_add_u8(session->out_buffer, SSH2_MSG_USERAUTH_INFO_RESPONSE) < 0 ||
buffer_add_u32(session->out_buffer,
htonl(session->kbdint->nprompts)) < 0) {