summaryrefslogtreecommitdiff
path: root/gtk/gtkcssparser.c
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2011-06-17 07:55:17 +0200
committerBenjamin Otte <otte@redhat.com>2011-08-26 16:26:28 +0200
commit8d6b560ff366394374dc0a96005cac14efe8d5ac (patch)
tree7cf1471b7c226dd3ef755ce608389c28837cad36 /gtk/gtkcssparser.c
parent62d231aeffe3b19c6f9b53e4d50f61c479e536db (diff)
downloadgtk+-8d6b560ff366394374dc0a96005cac14efe8d5ac.tar.gz
cssparser: Fix cases where we could overrun the terminating 0
Diffstat (limited to 'gtk/gtkcssparser.c')
-rw-r--r--gtk/gtkcssparser.c11
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++;