Skip to content

Commit

Permalink
reset process chunk if an error occurs
Browse files Browse the repository at this point in the history
  • Loading branch information
abenso committed Nov 5, 2024
1 parent 4518645 commit 2298e72
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/src/apdu_handler_legacy.c
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ bool legacy_process_transfer_chunk(uint32_t rx) {
offset += payload_size + 1;

if (offset > rx) {
tx_initialized = false;
THROW(APDU_CODE_DATA_INVALID);
}

Expand All @@ -281,6 +282,7 @@ bool legacy_process_transfer_chunk(uint32_t rx) {
legacy_append_data(&G_io_apdu_buffer[offset], payload_size + 1);

if (++items > LEGACY_TRANSFER_NUM_ITEMS) {
tx_initialized = false;
THROW(APDU_CODE_DATA_INVALID);
}

Expand Down

0 comments on commit 2298e72

Please sign in to comment.