Skip to content

Commit

Permalink
fix: use userauth name length to check memory boundaries for userauth…
Browse files Browse the repository at this point in the history
… name, fixes #653 (#654)

File: userauth.c

Notes:
Fixes `userauth_kybd_auth_name_len` length check 

Co-authored-by: Xaver Lopenstedt <xaver@lopenstedt.de>
  • Loading branch information
xalopp and Xaver Lopenstedt committed Jan 5, 2022
1 parent 552e20d commit 967792c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/userauth.c
Original file line number Diff line number Diff line change
Expand Up @@ -1794,7 +1794,7 @@ userauth_keyboard_interactive(LIBSSH2_SESSION * session,
"request field");
goto cleanup;
}
if(s + session->userauth_list_data_len <=
if(s + session->userauth_kybd_auth_name_len <=
session->userauth_kybd_data +
session->userauth_kybd_data_len) {
memcpy(session->userauth_kybd_auth_name, s,
Expand Down

0 comments on commit 967792c

Please sign in to comment.