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.
This commit is contained in:
parent
1711917c2c
commit
1d49f1bc21
@ -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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user