Closed KimiWu123 closed 5 years ago
It won't be touched, because the first byte will never be 0x04.
Hi @prusnak ,
Sure, I know the prefix of compressed public key will never be 0x04. What if users input incorrect key accidentally?
The key in the HDNode is always computed, never entered directly from an user.
in bip32.h, public key size is 33,
uint8_t public_key[33];
as following,If we follow the following path,
hdnode_get_address
-- >ecdsa_get_address
-->ecdsa_get_address_raw
-->ecdsa_get_pubkeyhash
the input public key of
ecdsa_get_address
isnode->public_key
which is 33 bytes, but in the above case, memory out of 33 bytes (index of 33 to 63) may be touched. It may cause program crash...