1
0
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:
Anderson Toshiyuki Sasaki
2020-04-08 15:08:34 +02:00
committed by Andreas Schneider
parent 0f33eecc01
commit e3e3a27863
2 changed files with 40 additions and 0 deletions

View File

@@ -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;
}