Skip to content

Commit

Permalink
fix: read of a uninitialized value in tx_info handlers
Browse files Browse the repository at this point in the history
  • Loading branch information
bboilot-ledger committed Dec 27, 2024
1 parent f86eb28 commit 3d91b22
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src_features/generic_tx_parser/gtp_tx_info.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ static bool handle_version(const s_tlv_data *data, s_tx_info_ctx *context) {

static bool handle_chain_id(const s_tlv_data *data, s_tx_info_ctx *context) {
uint64_t chain_id;
uint8_t buf[sizeof(chain_id)];
uint8_t buf[sizeof(chain_id)] = {0};

if (data->length > sizeof(buf)) {
return false;
Expand All @@ -72,7 +72,7 @@ static bool handle_chain_id(const s_tlv_data *data, s_tx_info_ctx *context) {
}

static bool handle_contract_addr(const s_tlv_data *data, s_tx_info_ctx *context) {
uint8_t buf[ADDRESS_LENGTH];
uint8_t buf[ADDRESS_LENGTH] = {0};

if (data->length > sizeof(buf)) {
return false;
Expand Down Expand Up @@ -165,7 +165,7 @@ static bool handle_contract_name(const s_tlv_data *data, s_tx_info_ctx *context)
}

static bool handle_deploy_date(const s_tlv_data *data, s_tx_info_ctx *context) {
uint8_t buf[sizeof(uint32_t)];
uint8_t buf[sizeof(uint32_t)] = {0};
time_t timestamp;

if (data->length > sizeof(buf)) {
Expand Down
2 changes: 1 addition & 1 deletion src_features/provideTrustedName/cmd_provide_trusted_name.c
Original file line number Diff line number Diff line change
Expand Up @@ -822,7 +822,7 @@ static bool parse_tlv(const s_tlv_payload *payload,
{.tag = NFT_ID, .func = &handle_nft_id},
};
e_tlv_step step = TLV_TAG;
s_tlv_data data;
s_tlv_data data = {0};
size_t offset = 0;
size_t tag_start_off;

Expand Down

0 comments on commit 3d91b22

Please sign in to comment.