Commit 5f5d3a9d authored by Benjamin Otte's avatar Benjamin Otte

css: Don't infloop when parsing broken borders

There was an infinite loop when parsing invalid text after having parsed
a color in the border shorthand. See attached testcase for an example.
parent 83c9fe10
......@@ -353,6 +353,13 @@ parse_border_side (GtkCssShorthandProperty *shorthand,
if (values[2] == NULL)
return FALSE;
}
else
{
/* We parsed and there's still stuff left?
* Pretend we didn't notice and let the normal code produce
* a 'junk at end of value' error */
break;
}
}
while (!value_is_done_parsing (parser));
......
......@@ -178,6 +178,9 @@ test_data = \
border.ref.css \
border-color-currentcolor.css \
border-color-currentcolor.ref.css \
border-infloop-3.12.css \
border-infloop-3.12.errors \
border-infloop-3.12.ref.css \
border-radius.css \
border-radius.errors \
border-radius.ref.css \
......
* {
border-bottom: tomato dot;
}
border-infloop-3.12.css:2: error: GTK_CSS_PROVIDER_ERROR_SYNTAX
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment