aboutsummaryrefslogtreecommitdiff
path: root/libssh/wrapper.c
diff options
context:
space:
mode:
Diffstat (limited to 'libssh/wrapper.c')
-rw-r--r--libssh/wrapper.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libssh/wrapper.c b/libssh/wrapper.c
index ae60b2e..a78a93d 100644
--- a/libssh/wrapper.c
+++ b/libssh/wrapper.c
@@ -223,10 +223,15 @@ int crypt_set_algorithms_server(ssh_session session){
enter_function();
/* out */
server = session->server_kex.methods[SSH_CRYPT_S_C];
- client = session->client_kex.methods[SSH_CRYPT_S_C];
+ if(session && session->client_kex.methods) {
+ client = session->client_kex.methods[SSH_CRYPT_S_C];
+ } else {
+ ssh_log(session,SSH_LOG_PROTOCOL, "Client KEX empty");
+ }
/* That's the client algorithms that are more important */
match = ssh_find_matching(server,client);
+
if(!match){
ssh_set_error(session,SSH_FATAL,"Crypt_set_algorithms_server : no matching algorithm function found for %s",server);
free(match);