Skip to content

Commit

Permalink
Free: Handle invalid schema with binary type inside mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
tlsa committed Jul 20, 2024
1 parent a15b55a commit 862518e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/free.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ static void cyaml__free_sequence(
const cyaml_schema_value_t *schema = sequence_schema->sequence.entry;
uint32_t data_size = schema->data_size;

if (schema->type == CYAML_BINARY) {
cyaml__log(cfg, CYAML_LOG_ERROR,
"Free: Invalid schema; binary outside mapping\n");
return;
}

cyaml__log(cfg, CYAML_LOG_DEBUG,
"Free: Freeing sequence with count: %u\n", count);

Expand Down

0 comments on commit 862518e

Please sign in to comment.