cssparser: Fix cases where we could overrun the terminating 0

This commit is contained in:
Benjamin Otte 2011-06-17 07:55:17 +02:00
parent 62d231aeff
commit 8d6b560ff3

View File

@ -875,16 +875,19 @@ _gtk_css_parser_resync_internal (GtkCssParser *parser,
case '(':
parser->data++;
_gtk_css_parser_resync (parser, FALSE, ')');
if (*parser->data)
parser->data++;
break;
case '[':
parser->data++;
_gtk_css_parser_resync (parser, FALSE, ']');
if (*parser->data)
parser->data++;
break;
case '{':
parser->data++;
_gtk_css_parser_resync (parser, FALSE, '}');
if (*parser->data)
parser->data++;
if (sync_at_semicolon || !terminator)
{
@ -902,6 +905,8 @@ _gtk_css_parser_resync_internal (GtkCssParser *parser,
}
parser->data++;
continue;
case '\0':
break;
case '/':
default:
parser->data++;