Skip to content

Commit

Permalink
descriptor: replace a now redundant assert
Browse files Browse the repository at this point in the history
descriptor->values is now an array, not a pointer, and so can never be
NULL - making this assert meaningless.

Replace it with an assertion that the claimed number of values fits
within the array size.
  • Loading branch information
jgriffiths committed Jan 20, 2025
1 parent 71b0934 commit ba68195
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion main/descriptor.c
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ bool descriptor_to_bytes(descriptor_data_t* descriptor, uint8_t* output_bytes, c
JADE_ASSERT(output_len == DESCRIPTOR_BYTES_LEN(descriptor));

JADE_ASSERT(descriptor->script_len);
JADE_ASSERT(descriptor->values || !descriptor->num_values);
JADE_ASSERT(descriptor->num_values <= sizeof(descriptor->values) / sizeof(descriptor->values[0]));

// Version byte
uint8_t* write_ptr = output_bytes;
Expand Down

0 comments on commit ba68195

Please sign in to comment.