mirror of
https://github.com/libssh2/libssh2.git
synced 2026-01-06 14:21:57 +03:00
Fix a NULL dereference of kex->exchange_keys during key exchange. (#1763)
Credit: Aldo Ristori
This commit is contained in:
@@ -4151,7 +4151,7 @@ _libssh2_kex_exchange(LIBSSH2_SESSION * session, int reexchange,
|
||||
key_state->state = libssh2_NB_state_sent2;
|
||||
}
|
||||
|
||||
if(rc == 0 && session->kex) {
|
||||
if(rc == 0 && session->kex && session->kex->exchange_keys) {
|
||||
if(key_state->state == libssh2_NB_state_sent2) {
|
||||
retcode = session->kex->exchange_keys(session,
|
||||
&key_state->key_state_low);
|
||||
|
||||
Reference in New Issue
Block a user