kex.c: fix possible NULL pointer de-reference with session->kex
Fixes VS2012 code analysis warning C6011: dereferencing NULL pointer 'session->kex'. libssh2 kex.c 1761
This commit is contained in:
parent
abcc0d370f
commit
1c1699545b
@ -1756,7 +1756,7 @@ _libssh2_kex_exchange(LIBSSH2_SESSION * session, int reexchange,
|
||||
key_state->state = libssh2_NB_state_sent2;
|
||||
}
|
||||
|
||||
if (rc == 0) {
|
||||
if (rc == 0 && session->kex) {
|
||||
if (key_state->state == libssh2_NB_state_sent2) {
|
||||
retcode = session->kex->exchange_keys(session,
|
||||
&key_state->key_state_low);
|
||||
|
Loading…
x
Reference in New Issue
Block a user