Skip to content

Commit 1e2ef6f

Browse files
Merge pull request #38 from LedgerHQ/security/merlin-4ab609e
fix: Null pointer dereference on missing wrapper.data in topology transaction parser
2 parents 643f255 + b5c1cc5 commit 1e2ef6f

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

src/transaction/pb_parser.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,14 @@ MUST_CHECK parser_status_e proto_deserialize_topology_transaction(buffer_t *buf,
8080

8181
PRINTF("Decoded Untyped Versioned Message.\n");
8282

83+
if (tx_ctx->tx_parts_ctx.untyped_versioned_msg.which_wrapper !=
84+
com_digitalasset_canton_version_v1_UntypedVersionedMessage_data_tag ||
85+
tx_ctx->tx_parts_ctx.untyped_versioned_msg.data == NULL ||
86+
tx_ctx->tx_parts_ctx.untyped_versioned_msg.data->size == 0) {
87+
PRINTF("Missing topology wrapper data\n");
88+
return VALUE_PARSING_ERROR;
89+
}
90+
8391
PRINTF("Untyped versioned message transaction wrapper type: %d\n",
8492
tx_ctx->tx_parts_ctx.untyped_versioned_msg.which_wrapper);
8593
PRINTF("Topology Transaction data size: %d\n",

0 commit comments

Comments
 (0)