Skip to content

Commit 09e54e3

Browse files
author
Cerberus Merlin
committed
fix: Array pass counter truncation can hide leading elements in generic transaction parser
1 parent 22f2f3f commit 09e54e3

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/features/generic_tx_parser/gtp_data_path.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ static bool path_slice(const s_slice_args *slice, s_parsed_value_collection *col
215215

216216
typedef struct {
217217
uint8_t depth;
218-
uint8_t passes_remaining[MAX_ARRAYS];
218+
uint16_t passes_remaining[MAX_ARRAYS];
219219
uint8_t index;
220220
} s_arrays_info;
221221

@@ -257,6 +257,10 @@ static bool path_array(const s_array_args *array,
257257
return false;
258258
}
259259
passes = end - start;
260+
if (passes > MAX_VALUE_COLLECTION_SIZE) {
261+
PRINTF("Error: array too large for display\n");
262+
return false;
263+
}
260264

261265
*offset += 1;
262266
if (arrays_info->index == arrays_info->depth) {

0 commit comments

Comments
 (0)