From 3cd06a1f26057f36ef91c3fa86605d2b75905ffc Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Wed, 22 Jul 2009 12:18:34 +0200 Subject: [PATCH] Don't segfault if the session or the answer is NULL. --- libssh/auth.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libssh/auth.c b/libssh/auth.c index aadba0ba..77d4d218 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; }