mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-06-11 12:56:21 +09:00
auth: Avoid off-by-one overflow during kbdint authentication
Based on incomplete !754 Signed-off-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Pavol Žáčik <pzacik@redhat.com> Merge-Request: <https://gitlab.com/libssh/libssh-mirror/-/merge_requests/827>
This commit is contained in:
@@ -2417,7 +2417,7 @@ ssh_userauth_kbdint_getprompt(ssh_session session, unsigned int i, char *echo)
|
||||
ssh_set_error_invalid(session);
|
||||
return NULL;
|
||||
}
|
||||
if (i > session->kbdint->nprompts) {
|
||||
if (i >= session->kbdint->nprompts) {
|
||||
ssh_set_error_invalid(session);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user