Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

flamenco: make transaction parsing errors return sanitize failure error #4055

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -2778,3 +2778,4 @@ dump/test-vectors/txn/fixtures/programs/2ab448fbadb0b964c56472758c7a46920f8591e5
dump/test-vectors/txn/fixtures/programs/e54e613fb6cab91a508bda54fff4d5ea2e238ee3_1777641.fix
dump/test-vectors/txn/fixtures/programs/b7d8956145950269da4dc2215fd6f149d1261e0b_1768662.fix
dump/test-vectors/txn/fixtures/programs/39376265439c3d3765a1a9b94d1beb3e643b6653_1769070.fix
dump/test-vectors/txn/fixtures/programs/a6d7f4390dadb86e7aa5414a054cc6e239eec615_1094896.fix
5 changes: 5 additions & 0 deletions src/flamenco/runtime/tests/fd_exec_instr_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -842,6 +842,11 @@ _txn_context_create_and_exec( fd_exec_instr_test_runner_t * runner,
// Compact array of 8-bit data
pb_bytes_array_t * data = test_ctx->tx.message.instructions[i].data;
if( data ) {
uint data_len_raw = data->size;
if( data_len_raw > USHORT_MAX ) {
return NULL;
}

ushort data_len = (ushort) data->size;
_add_compact_u16( &txn_raw_cur_ptr, data_len );
_add_to_data( &txn_raw_cur_ptr, data->bytes, data_len );
Expand Down
Loading