forked from AuroraMiddleware/gtk
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.
This commit is contained in:
parent
83c9fe109e
commit
5f5d3a9d82
@ -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 \
|
||||
|
3
testsuite/css/parser/border-infloop-3.12.css
Normal file
3
testsuite/css/parser/border-infloop-3.12.css
Normal file
@ -0,0 +1,3 @@
|
||||
* {
|
||||
border-bottom: tomato dot;
|
||||
}
|
1
testsuite/css/parser/border-infloop-3.12.errors
Normal file
1
testsuite/css/parser/border-infloop-3.12.errors
Normal file
@ -0,0 +1 @@
|
||||
border-infloop-3.12.css:2: error: GTK_CSS_PROVIDER_ERROR_SYNTAX
|
0
testsuite/css/parser/border-infloop-3.12.ref.css
Normal file
0
testsuite/css/parser/border-infloop-3.12.ref.css
Normal file
Loading…
Reference in New Issue
Block a user