aboutsummaryrefslogtreecommitdiff
path: root/src/auth.c
diff options
context:
space:
mode:
authorAnderson Toshiyuki Sasaki <ansasaki@redhat.com>2019-11-05 14:10:01 +0100
committerAndreas Schneider <asn@cryptomilk.org>2019-11-18 11:59:01 +0100
commit7e3995d2dd0b8cb731f9391c419c7848d0d5a3f6 (patch)
tree98e1d1d471f07ee6a9cbd22b358fa1a9d3c203c6 /src/auth.c
parent77bd8ed4c0dd3526218184b983cdc2e4c5695abf (diff)
downloadlibssh-7e3995d2dd0b8cb731f9391c419c7848d0d5a3f6.tar.gz
libssh-7e3995d2dd0b8cb731f9391c419c7848d0d5a3f6.tar.xz
libssh-7e3995d2dd0b8cb731f9391c419c7848d0d5a3f6.zip
auth: Set auto_state->state explicitly
When a new ssh_auth_auto_state_struct is allocated in ssh_userauth_publickey_auto(), initialize the state explicitly for better readability. Fixes T194 Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Diffstat (limited to 'src/auth.c')
-rw-r--r--src/auth.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/auth.c b/src/auth.c
index edc8ef0b..db1e6bb7 100644
--- a/src/auth.c
+++ b/src/auth.c
@@ -1031,6 +1031,9 @@ int ssh_userauth_publickey_auto(ssh_session session,
ssh_set_error_oom(session);
return SSH_AUTH_ERROR;
}
+
+ /* Set state explicitly */
+ session->auth.auto_state->state = SSH_AUTH_AUTO_STATE_NONE;
}
state = session->auth.auto_state;
if (state->state == SSH_AUTH_AUTO_STATE_NONE) {