diff options
author | Andreas Schneider <asn@cryptomilk.org> | 2011-09-11 15:29:27 +0200 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2011-09-11 15:29:27 +0200 |
commit | 3b5bdc5db440b8bf2d142631cac44c4eb052e7bc (patch) | |
tree | eebb99949d4cfcb1e64599140ed614c664a04e01 /src/auth.c | |
parent | 95ec57f2fd5c1a339925e5e23bd4f7f0a8081dc9 (diff) | |
download | libssh-3b5bdc5db440b8bf2d142631cac44c4eb052e7bc.tar.gz libssh-3b5bdc5db440b8bf2d142631cac44c4eb052e7bc.tar.xz libssh-3b5bdc5db440b8bf2d142631cac44c4eb052e7bc.zip |
auth: Check if we have any prompts.
Diffstat (limited to 'src/auth.c')
-rw-r--r-- | src/auth.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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; |