From 0408d8d8515465feb71ce5e0d7ab85839cef366d Mon Sep 17 00:00:00 2001 From: Anderson Toshiyuki Sasaki Date: Tue, 5 Nov 2019 14:10:01 +0100 Subject: [PATCH] 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 Reviewed-by: Andreas Schneider (cherry picked from commit 7e3995d2dd0b8cb731f9391c419c7848d0d5a3f6) --- src/auth.c | 3 +++ 1 file changed, 3 insertions(+) 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) {