mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-09-11 13:30:43 +03:00
client: Check if the library is initialized in ssh_connect()
If the library is not initialized, SSH_ERROR is returned and the error message is set properly. Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
committed by
Andreas Schneider
parent
0f33eecc01
commit
e3e3a27863
@@ -509,6 +509,13 @@ int ssh_connect(ssh_session session)
|
||||
{
|
||||
int ret;
|
||||
|
||||
if (!is_ssh_initialized()) {
|
||||
ssh_set_error(session, SSH_FATAL,
|
||||
"Library not initialized.");
|
||||
|
||||
return SSH_ERROR;
|
||||
}
|
||||
|
||||
if (session == NULL) {
|
||||
return SSH_ERROR;
|
||||
}
|
||||
|
Reference in New Issue
Block a user