Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src_features/generic_tx_parser/calldata.c
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ const uint8_t *calldata_get_selector(void) {

const uint8_t *calldata_get_chunk(int idx) {
size_t offset = 0;
size_t offset_after;

if (!has_valid_calldata(g_calldata) || (g_calldata->chunks == NULL)) {
return NULL;
Expand All @@ -208,7 +209,10 @@ const uint8_t *calldata_get_chunk(int idx) {
if (offset > g_calldata->chunks_size) return NULL;
offset += sizeof(chunk_info_t) + CHUNK_INFO_SIZE(g_calldata->chunks[offset]);
}
if (!decompress_chunk(g_calldata, offset)) return NULL;
offset_after = offset + sizeof(chunk_info_t) + CHUNK_INFO_SIZE(g_calldata->chunks[offset]);
if ((offset_after > g_calldata->chunks_size) || !decompress_chunk(g_calldata, offset)) {
return NULL;
}
return g_calldata->chunk;
}

Expand Down
Loading