Skip to content

Commit

Permalink
Merge pull request #203 from Zondax/fix-swap
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosala authored Oct 16, 2023
2 parents 6fa4193 + f9d11c9 commit 27ae1b7
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 27ae1b7

Please sign in to comment.