csstokenizer: Fix an out of bounds when reading an ident followed by EOF

This commit is contained in:
Alice Mikhaylenko 2024-03-20 21:36:52 +04:00
parent e5e147ad53
commit 840cd6e44c

View File

@ -1020,7 +1020,7 @@ gtk_css_tokenizer_read_ident_like (GtkCssTokenizer *tokenizer,
{ {
gtk_css_tokenizer_read_name (tokenizer); gtk_css_tokenizer_read_name (tokenizer);
if (*tokenizer->data == '(') if (gtk_css_tokenizer_remaining (tokenizer) > 0 && *tokenizer->data == '(')
{ {
gtk_css_tokenizer_consume_ascii (tokenizer); gtk_css_tokenizer_consume_ascii (tokenizer);
if (g_ascii_strcasecmp (tokenizer->name_buffer->str, "url") == 0) if (g_ascii_strcasecmp (tokenizer->name_buffer->str, "url") == 0)