From 1d49f1bc21e9348dab963e94e9056bcee2fdcf19 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 29 Mar 2010 17:19:58 +0200 Subject: [PATCH] handle a NULL password as if it was "" libssh2_userauth_publickey_fromfile_ex() takes a "passphrase" but didn't deal with it being set to NULL. --- src/userauth.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/userauth.c b/src/userauth.c index 54ee611..993bc00 100644 --- a/src/userauth.c +++ b/src/userauth.c @@ -1318,6 +1318,12 @@ libssh2_userauth_publickey_fromfile_ex(LIBSSH2_SESSION *session, const char *passphrase) { int rc; + + if(NULL == passphrase) + /* if given a NULL pointer, make it point to a zero-length + string to save us from having to check this all over */ + passphrase=""; + BLOCK_ADJUST(rc, session, userauth_publickey_fromfile(session, user, user_len, publickey, privatekey,