From 6e56d1dfb20c705930770a96f6d84730a4f58a14 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Wed, 22 Jul 2009 12:18:34 +0200 Subject: 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; } -- cgit v1.2.3