1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-11-29 01:03:57 +03:00

auth: Check if we have any prompts.

This commit is contained in:
Andreas Schneider
2011-09-11 15:29:27 +02:00
parent 95ec57f2fd
commit 3b5bdc5db4

View File

@@ -1684,9 +1684,10 @@ SSH_PACKET_CALLBACK(ssh_packet_userauth_info_request) {
nprompts = ntohl(nprompts);
ssh_log(session,SSH_LOG_PACKET,"kbdint: %d prompts",nprompts);
if (nprompts > KBDINT_MAX_PROMPT) {
if (nprompts == 0 ||
nprompts > KBDINT_MAX_PROMPT) {
ssh_set_error(session, SSH_FATAL,
"Too much prompt asked from server: %u (0x%.4x)",
"Wrong number of prompts requested by the server: %u (0x%.4x)",
nprompts, nprompts);
ssh_kbdint_free(session->kbdint);
session->kbdint = NULL;