diff options
author | Benjamin Otte <otte@redhat.com> | 2011-06-17 07:55:17 +0200 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2011-08-26 16:26:28 +0200 |
commit | 8d6b560ff366394374dc0a96005cac14efe8d5ac (patch) | |
tree | 7cf1471b7c226dd3ef755ce608389c28837cad36 /gtk/gtkcssparser.c | |
parent | 62d231aeffe3b19c6f9b53e4d50f61c479e536db (diff) | |
download | gtk+-8d6b560ff366394374dc0a96005cac14efe8d5ac.tar.gz |
cssparser: Fix cases where we could overrun the terminating 0
Diffstat (limited to 'gtk/gtkcssparser.c')
-rw-r--r-- | gtk/gtkcssparser.c | 11 |
1 files changed, 8 insertions, 3 deletions
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++; |