aboutsummaryrefslogtreecommitdiff
path: root/libssh/auth.c
diff options
context:
space:
mode:
authorAndreas Schneider <mail@cynapses.org>2009-07-22 12:18:34 +0200
committerAndreas Schneider <mail@cynapses.org>2009-07-22 12:18:34 +0200
commit3cd06a1f26057f36ef91c3fa86605d2b75905ffc (patch)
treefab8053329b5845e4a5eb849940693c229b722bc /libssh/auth.c
parent19c3d02805643c004c1e669d34018ed570146418 (diff)
downloadlibssh-3cd06a1f26057f36ef91c3fa86605d2b75905ffc.tar.gz
libssh-3cd06a1f26057f36ef91c3fa86605d2b75905ffc.tar.xz
libssh-3cd06a1f26057f36ef91c3fa86605d2b75905ffc.zip
Don't segfault if the session or the answer is NULL.
Diffstat (limited to 'libssh/auth.c')
-rw-r--r--libssh/auth.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libssh/auth.c b/libssh/auth.c
index aadba0b..77d4d21 100644
--- a/libssh/auth.c
+++ b/libssh/auth.c
@@ -1475,7 +1475,7 @@ const char *ssh_userauth_kbdint_getprompt(SSH_SESSION *session, unsigned int i,
*/
int ssh_userauth_kbdint_setanswer(SSH_SESSION *session, unsigned int i,
const char *answer) {
- if (i > session->kbdint->nprompts) {
+ if (session == NULL || answer == NULL || i > session->kbdint->nprompts) {
return -1;
}