Skip to content

Commit

Permalink
vaev-style: Fix buffer index out of bound in op code peeking.
Browse files Browse the repository at this point in the history
  • Loading branch information
sleepy-monax committed Aug 9, 2024
1 parent c7e70ae commit f1d9e49
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/web/vaev-style/select.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -292,8 +292,9 @@ static OpCode _peekOpCode(Cursor<Css::Sst> &cur) {
return OpCode::DESCENDANT;
} else {
auto op = _peekOpCode(cur);
cur.next();

if (cur.peek(1).token.type == Css::Token::WHITESPACE) {
if (cur.skip(Css::Token::WHITESPACE)) {
if (cur.ended()) {
return OpCode::NOP;
}
Expand Down

0 comments on commit f1d9e49

Please sign in to comment.