[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Segment fault in privatekey_from_file (0.4 git)


Hi,

I recently pull the latest from git and found this segfault. The
"callback" member is NULL which caused this. The attached patch fix it.

Thanks,

Vic
From 142f515325ef2d8275aa31bf5cdc859ce28bed86 Mon Sep 17 00:00:00 2001
From: Vic Lee <llyzs@xxxxxxx>
Date: Mon, 5 Oct 2009 14:07:33 +0800
Subject: [PATCH] Fix a segment fault in privatekey_from_file


Signed-off-by: Vic Lee <llyzs@xxxxxxx>
---
 libssh/keyfiles.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libssh/keyfiles.c b/libssh/keyfiles.c
index d368a28..ac10c45 100644
--- a/libssh/keyfiles.c
+++ b/libssh/keyfiles.c
@@ -648,7 +648,7 @@ ssh_private_key privatekey_from_file(ssh_session session, const char *filename,
 
   ssh_log(session, SSH_LOG_RARE, "Trying to read %s, passphase=%s, authcb=%s",
       filename, passphrase ? "true" : "false",
-      session->callbacks->auth_function ? "true" : "false");
+      session->callbacks && session->callbacks->auth_function ? "true" : "false");
   switch (type) {
     case TYPE_DSS:
       if (passphrase == NULL) {
-- 
1.6.3.3


Archive administrator: postmaster@lists.cynapses.org