aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--examples/authentication.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/examples/authentication.c b/examples/authentication.c
index c233e300..0e749e54 100644
--- a/examples/authentication.c
+++ b/examples/authentication.c
@@ -86,7 +86,9 @@ int authenticate_kbdint(ssh_session session, const char *password) {
}
answer = buffer;
}
- if (ssh_userauth_kbdint_setanswer(session, i, answer) < 0) {
+ err = ssh_userauth_kbdint_setanswer(session, i, answer);
+ memset(buffer, 0, sizeof(buffer));
+ if (err < 0) {
return SSH_AUTH_ERROR;
}
}
@@ -152,6 +154,7 @@ int authenticate_console(ssh_session session){
break;
}
}
+ memset(password, 0, sizeof(password));
}
banner = ssh_get_issue_banner(session);