summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schneider <mail@cynapses.org>2009-07-22 12:18:34 +0200
committerAndreas Schneider <mail@cynapses.org>2009-07-23 09:07:36 +0200
commit6e56d1dfb20c705930770a96f6d84730a4f58a14 (patch)
tree511ee90f24c303f3e9ebaffbb8354ce69f57eb2b
parentb07ec7a3d125bd17f7769e471fe82e9a7aba22bf (diff)
downloadlibssh-6e56d1dfb20c705930770a96f6d84730a4f58a14.tar.gz
libssh-6e56d1dfb20c705930770a96f6d84730a4f58a14.tar.xz
libssh-6e56d1dfb20c705930770a96f6d84730a4f58a14.zip
Don't segfault if the session or the answer is NULL.
-rw-r--r--libssh/auth.c2
1 files changed, 1 insertions, 1 deletions
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;
}