From 809da3ce338f67ac7308838e603941c4d6b02e58 Mon Sep 17 00:00:00 2001 From: TamtamHero <10632523+TamtamHero@users.noreply.github.com> Date: Tue, 8 Dec 2020 13:06:24 +0100 Subject: [PATCH] Fix sizeof on address instead of value --- src/handle_check_address.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/handle_check_address.c b/src/handle_check_address.c index 50b9ddf..afe9aa7 100644 --- a/src/handle_check_address.c +++ b/src/handle_check_address.c @@ -4,7 +4,7 @@ #include "ethUtils.h" #include "string.h" -#define ZERO(x) memset(x, 0, sizeof(x)) +#define ZERO(x) memset(&x, 0, sizeof(x)) static int os_strcmp(const char* s1, const char* s2) { size_t size = strlen(s1) + 1; @@ -50,19 +50,19 @@ int handle_check_address(check_address_parameters_t* params, chain_config_t* cha bip32PathLength, locals_union2.privateKeyData, NULL); - ZERO(&locals_union1); + ZERO(locals_union1); cx_ecfp_init_private_key(CX_CURVE_256K1, locals_union2.privateKeyData, 32, &locals_union1.privateKey); - ZERO(&locals_union2); + ZERO(locals_union2); cx_ecfp_generate_pair(CX_CURVE_256K1, &locals_union2.publicKey, &locals_union1.privateKey, 1); - ZERO(&locals_union1); + ZERO(locals_union1); getEthAddressStringFromKey(&locals_union2.publicKey, (uint8_t*) locals_union1.address, &local_sha3, chain_config); - ZERO(&locals_union2); + ZERO(locals_union2); uint8_t offset_0x = 0; if (memcmp(params->address_to_check, "0x", 2) == 0) {