diff options
Diffstat (limited to 'src/libserver/css/css_tokeniser.cxx')
-rw-r--r-- | src/libserver/css/css_tokeniser.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libserver/css/css_tokeniser.cxx b/src/libserver/css/css_tokeniser.cxx index 8d08eb7a2..d07b017a3 100644 --- a/src/libserver/css/css_tokeniser.cxx +++ b/src/libserver/css/css_tokeniser.cxx @@ -250,7 +250,7 @@ auto css_tokeniser::consume_ident(bool allow_number) -> struct css_parser_token } if (input.size() - offset > 3 && input.substr(offset, 3) == "url") { - if (input[j] == '"' || input[j] == '\'') { + if (j < input.size() && (input[j] == '"' || input[j] == '\'')) { /* Function token */ auto ret = maybe_escape_sv(i, css_parser_token::token_type::function_token); @@ -262,7 +262,7 @@ auto css_tokeniser::consume_ident(bool allow_number) -> struct css_parser_token j++; } - if (input[j] == ')') { + if (j < input.size() && input[j] == ')') { /* Valid url token */ auto ret = maybe_escape_sv(j + 1, css_parser_token::token_type::url_token); |