diff --git a/src/swap/handle_sign_transaction.c b/src/swap/handle_sign_transaction.c index 96ba3b96..c93a44bc 100644 --- a/src/swap/handle_sign_transaction.c +++ b/src/swap/handle_sign_transaction.c @@ -94,6 +94,10 @@ bool swap_check_destination_validity(tx_output_destination_t* destination) { destination->address.size, rawAddressHuman, sizeof(rawAddressHuman)); + if (strlen(G_swap_validated.destination) != addrLen) { + PRINTF("Invalid size. %d/%d\n", strlen(G_swap_validated.destination), addrLen); + return false; + } if (strncmp(G_swap_validated.destination, rawAddressHuman, addrLen) != 0) { PRINTF("Destination requested in this transaction = %s\n", rawAddressHuman); PRINTF("Destination validated in swap = %s\n", G_swap_validated.destination); @@ -180,7 +184,6 @@ bool swap_check_fee_validity(uint64_t fee) { void __attribute__((noreturn)) swap_finalize_exchange_sign_transaction(bool is_success) { PRINTF("is_success: %d\n", is_success); *G_swap_sign_return_value_address = is_success; - memset(&G_swap_validated, 0, sizeof(G_swap_validated)); os_lib_end(); }