File tree Expand file tree Collapse file tree
src_features/generic_tx_parser Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -200,6 +200,7 @@ const uint8_t *calldata_get_selector(void) {
200200
201201const uint8_t * calldata_get_chunk (int idx ) {
202202 size_t offset = 0 ;
203+ size_t offset_after ;
203204
204205 if (!has_valid_calldata (g_calldata ) || (g_calldata -> chunks == NULL )) {
205206 return NULL ;
@@ -208,7 +209,10 @@ const uint8_t *calldata_get_chunk(int idx) {
208209 if (offset > g_calldata -> chunks_size ) return NULL ;
209210 offset += sizeof (chunk_info_t ) + CHUNK_INFO_SIZE (g_calldata -> chunks [offset ]);
210211 }
211- if (!decompress_chunk (g_calldata , offset )) return NULL ;
212+ offset_after = offset + sizeof (chunk_info_t ) + CHUNK_INFO_SIZE (g_calldata -> chunks [offset ]);
213+ if ((offset_after > g_calldata -> chunks_size ) || !decompress_chunk (g_calldata , offset )) {
214+ return NULL ;
215+ }
212216 return g_calldata -> chunk ;
213217}
214218
You can’t perform that action at this time.
0 commit comments