From 8d6b560ff366394374dc0a96005cac14efe8d5ac Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Fri, 17 Jun 2011 07:55:17 +0200 Subject: cssparser: Fix cases where we could overrun the terminating 0 --- gtk/gtkcssparser.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'gtk/gtkcssparser.c') diff --git a/gtk/gtkcssparser.c b/gtk/gtkcssparser.c index 13d63d4869..2d6a4df3d0 100644 --- a/gtk/gtkcssparser.c +++ b/gtk/gtkcssparser.c @@ -875,17 +875,20 @@ _gtk_css_parser_resync_internal (GtkCssParser *parser, case '(': parser->data++; _gtk_css_parser_resync (parser, FALSE, ')'); - parser->data++; + if (*parser->data) + parser->data++; break; case '[': parser->data++; _gtk_css_parser_resync (parser, FALSE, ']'); - parser->data++; + if (*parser->data) + parser->data++; break; case '{': parser->data++; _gtk_css_parser_resync (parser, FALSE, '}'); - parser->data++; + if (*parser->data) + parser->data++; if (sync_at_semicolon || !terminator) { _gtk_css_parser_skip_whitespace (parser); @@ -902,6 +905,8 @@ _gtk_css_parser_resync_internal (GtkCssParser *parser, } parser->data++; continue; + case '\0': + break; case '/': default: parser->data++; -- cgit v1.2.1