Skip to content

Commit

Permalink
check address len in swap mode
Browse files Browse the repository at this point in the history
Closes #202
  • Loading branch information
fbeutin-ledger authored and carlosala committed Oct 16, 2023
1 parent 6fa4193 commit f9d11c9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/src/swap/handle_check_address.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,10 @@ void handle_check_address(check_address_parameters_t* params) {
const uint8_t *address = buffer + PK_LEN_25519;
const uint8_t addressLen = replyLen - PK_LEN_25519;

if (addressLen == params->address_parameters_length &&
// Exchange guarantees that the input string is '\0' terminated
uint8_t address_to_check_len = strlen(params->address_to_check);

if (addressLen == address_to_check_len &&
memcmp(address, params->address_to_check, addressLen) == 0) {
params->result = 1;
}
Expand Down

0 comments on commit f9d11c9

Please sign in to comment.