mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-04 12:20:42 +09:00
session: Initialize states explicitly
In ssh_session_new(), initialize the state machines states explicitly
for better readability.
Fixes T194
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
(cherry picked from commit ec67ad47eb)
This commit is contained in:
committed by
Andreas Schneider
parent
eeb9ae15c7
commit
7856ae594b
@@ -162,6 +162,16 @@ ssh_session ssh_new(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Explicitly initialize states */
|
||||
session->session_state = SSH_SESSION_STATE_NONE;
|
||||
session->pending_call_state = SSH_PENDING_CALL_NONE;
|
||||
session->packet_state = PACKET_STATE_INIT;
|
||||
session->dh_handshake_state = DH_STATE_INIT;
|
||||
session->global_req_state = SSH_CHANNEL_REQ_STATE_NONE;
|
||||
|
||||
session->auth.state = SSH_AUTH_STATE_NONE;
|
||||
session->auth.service_state = SSH_AUTH_SERVICE_NONE;
|
||||
|
||||
return session;
|
||||
|
||||
err:
|
||||
|
||||
Reference in New Issue
Block a user