Protect escaping from overrun

This commit is contained in:
Andrey Borodin 2021-06-29 11:13:06 +05:00
parent b66b2f3b43
commit b4d84db3f2
1 changed files with 1 additions and 1 deletions

View File

@ -146,7 +146,7 @@ static inline int od_parser_next(od_parser_t *parser, od_token_t *token)
token->type = OD_PARSER_ERROR;
return token->type;
}
if (*parser->pos == '\\')
if ((*parser->pos == '\\') && (parser->pos + 1 != parser->end))
parser->pos += 2;
else
parser->pos++;