Skip to content

Commit

Permalink
[Minor] Try to fix potential off-by-one error
Browse files Browse the repository at this point in the history
  • Loading branch information
vstakhov committed Nov 17, 2022
1 parent ed4f55c commit 07d4d68
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/libserver/css/css_tokeniser.cxx
Expand Up @@ -441,6 +441,11 @@ auto css_tokeniser::next_token(void) -> struct css_parser_token
auto i = offset;
auto nested = 0;

if (input.empty()) {
/* Nothing to consume */
return;
}

/* We handle nested comments just because they can exist... */
while (i < input.size() - 1) {
auto c = input[i];
Expand Down

0 comments on commit 07d4d68

Please sign in to comment.