From a479b302983aae2878af0cb50eac141ede6cd942 Mon Sep 17 00:00:00 2001 From: Aris Adamantiadis Date: Sat, 17 Oct 2009 17:54:39 +0200 Subject: [PATCH] Verify existence of callback before using them --- libssh/keyfiles.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libssh/keyfiles.c b/libssh/keyfiles.c index 1fff4443..2fe6e8aa 100644 --- a/libssh/keyfiles.c +++ b/libssh/keyfiles.c @@ -692,7 +692,7 @@ ssh_private_key privatekey_from_file(ssh_session session, const char *filename, break; case TYPE_RSA: if (passphrase == NULL) { - if (session->callbacks->auth_function) { + if (session->callbacks && session->callbacks->auth_function) { auth_cb = session->callbacks->auth_function; auth_ud = session->callbacks->userdata; #ifdef HAVE_LIBGCRYPT