1
0
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:
Michael Buckley
2025-12-19 15:41:45 -08:00
committed by GitHub
parent c10cb2449c
commit 631e2f82a3

View File

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