Skip to content

Commit

Permalink
Merge pull request #297 from vstakhov/vstakhov-fix-fuzz
Browse files Browse the repository at this point in the history
Do not enter macro state with macros disabled
  • Loading branch information
vstakhov committed Apr 20, 2024
2 parents 0a94bbd + bb92fa4 commit ac160cf
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/ucl_parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -1372,12 +1372,8 @@ ucl_parse_key (struct ucl_parser *parser, struct ucl_chunk *chunk,

p = chunk->pos;

if (*p == '.') {
/* It is macro actually */
if (!(parser->flags & UCL_PARSER_DISABLE_MACRO)) {
ucl_chunk_skipc (chunk, p);
}

if (*p == '.' && !(parser->flags & UCL_PARSER_DISABLE_MACRO)) {
ucl_chunk_skipc (chunk, p);
parser->prev_state = parser->state;
parser->state = UCL_STATE_MACRO_NAME;
*end_of_object = false;
Expand Down Expand Up @@ -1415,7 +1411,7 @@ ucl_parse_key (struct ucl_parser *parser, struct ucl_chunk *chunk,
*end_of_object = true;
return true;
}
else if (*p == '.') {
else if (*p == '.' && !(parser->flags & UCL_PARSER_DISABLE_MACRO)) {
ucl_chunk_skipc (chunk, p);
parser->prev_state = parser->state;
parser->state = UCL_STATE_MACRO_NAME;
Expand Down

0 comments on commit ac160cf

Please sign in to comment.