Skip to content
Commit 0218a737 authored by Tyler Hall's avatar Tyler Hall Committed by Daniel Stenberg
Browse files

ssh: Handle successful SSH_USERAUTH_NONE



According to the documentation for libssh2_userauth_list(), a NULL
return value is not necessarily an error. You must call
libssh2_userauth_authenticated() to determine if the SSH_USERAUTH_NONE
request was successful.

This fixes a segv when using sftp on a server that allows logins with an
empty password. When NULL was interpreted as an error, it would
free the session but not flag an error since the libssh2 errno would be
clear. This resulted in dereferencing a NULL session pointer.

Signed-off-by: default avatarTyler Hall <tylerwhall@gmail.com>
parent 18ca0aa9
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment