From 71dc351467f84548a09cfcc2ea8da17c4c9345b6 Mon Sep 17 00:00:00 2001 From: Alexandros Theodotou Date: Sun, 9 Feb 2020 19:49:35 +0000 Subject: [PATCH] apply type-check patch (https://github.com/tlsa/libcyaml/pull/112) --- src/load.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/load.c b/src/load.c index 2c55b57..ff215b9 100644 --- a/src/load.c +++ b/src/load.c @@ -1924,11 +1924,6 @@ static cyaml_err_t cyaml__read_value( cyaml__type_to_str(schema->type), schema->flags & CYAML_FLAG_POINTER ? " (pointer)" : ""); - err = cyaml__validate_event_type_for_schema(ctx, schema, event); - if (err != CYAML_OK) { - return err; - } - if (cyaml_event == CYAML_EVT_SCALAR) { if (cyaml__string_is_null_ptr(schema, (const char *)event->data.scalar.value)) { @@ -1938,6 +1933,11 @@ static cyaml_err_t cyaml__read_value( } } + err = cyaml__validate_event_type_for_schema(ctx, schema, event); + if (err != CYAML_OK) { + return err; + } + if (cyaml__is_sequence(schema) == false) { /* Since sequences extend their allocation for each entry, * they're handled in the sequence-specific code. -- 2.45.2