Skip to content

Commit

Permalink
Apply the same fix in other places of the parser
Browse files Browse the repository at this point in the history
  • Loading branch information
vstakhov committed Apr 25, 2024
1 parent 047b02b commit 1e409ae
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/ucl_msgpack.c
Original file line number Diff line number Diff line change
Expand Up @@ -1212,10 +1212,12 @@ ucl_msgpack_consume (struct ucl_parser *parser)

assert (key != NULL && keylen > 0);

if (!ucl_msgpack_insert_object (parser, key, keylen,
if (parser->cur_obj) {
if (!ucl_msgpack_insert_object(parser, key, keylen,
parser->cur_obj)) {

return false;
return false;
}
}

key = NULL;
Expand Down Expand Up @@ -1304,9 +1306,11 @@ ucl_msgpack_consume (struct ucl_parser *parser)


/* Insert value to the container and check if we have finished array */
if (!ucl_msgpack_insert_object (parser, NULL, 0,
if (parser->cur_obj) {
if (!ucl_msgpack_insert_object(parser, NULL, 0,
parser->cur_obj)) {
return false;
return false;
}
}
break;
case finish_array_value:
Expand Down

0 comments on commit 1e409ae

Please sign in to comment.