Fix screen message buffer overwrite

This commit is contained in:
Charles-Edouard de la Vergne 2024-03-13 11:48:12 +01:00
parent 1d16c87fc8
commit 6983d8cbb8
No known key found for this signature in database
GPG Key ID: F12296941B7BB9C6
2 changed files with 7 additions and 7 deletions

View File

@ -425,7 +425,7 @@ static void validate_pin() {
sizeof(G_gpg_vstate.menu),
" %d tries remaining",
pin->counter);
ui_info(WRONG_PIN, EMPTY, ui_menu_main_display, 0);
ui_info(WRONG_PIN, G_gpg_vstate.menu, ui_menu_main_display, 0);
return;
}
offset = 1 + G_gpg_vstate.work.io_buffer[0];

View File

@ -329,11 +329,11 @@ static void validate_pin() {
gpg_io_insert_u16(sw);
gpg_io_do(IO_RETURN_AFTER_TX);
if (sw != SW_OK) {
snprintf(G_gpg_vstate.menu,
sizeof(G_gpg_vstate.menu),
snprintf(G_gpg_vstate.ux_buff1,
sizeof(G_gpg_vstate.ux_buff1),
" %d tries remaining",
pin->counter);
ui_info(WRONG_PIN, G_gpg_vstate.menu);
ui_info(WRONG_PIN, G_gpg_vstate.ux_buff1);
} else {
ui_menu_main_display(0);
}
@ -354,11 +354,11 @@ static void validate_pin() {
gpg_io_discard(1);
gpg_io_insert_u16(SW_CONDITIONS_NOT_SATISFIED);
gpg_io_do(IO_RETURN_AFTER_TX);
snprintf(G_gpg_vstate.menu,
sizeof(G_gpg_vstate.menu),
snprintf(G_gpg_vstate.ux_buff1,
sizeof(G_gpg_vstate.ux_buff1),
" %d tries remaining",
pin->counter);
ui_info(WRONG_PIN, EMPTY);
ui_info(WRONG_PIN, G_gpg_vstate.ux_buff1);
return;
}
offset = 1 + G_gpg_vstate.work.io_buffer[0];