diff options
author | Emmanuele Bassi <ebassi@gnome.org> | 2017-03-13 09:10:59 +0000 |
---|---|---|
committer | Emmanuele Bassi <ebassi@gnome.org> | 2017-03-13 09:15:42 +0000 |
commit | 0cb1db37f8a1edf95f8d14c8868091804e54e4c3 (patch) | |
tree | 09ca674fbb1fa71a8659b8b44cade1c3a86228b7 | |
parent | 43da2c261c644be17894a3319b62c9125a569428 (diff) | |
download | json-glib-0cb1db37f8a1edf95f8d14c8868091804e54e4c3.tar.gz |
Only seal arrays and objects when a parser is immutable
We seal nodes conditionally on the :immutable property, but we are
sealing their contents unconditionally.
https://bugzilla.gnome.org/show_bug.cgi?id=779970
-rw-r--r-- | json-glib/json-parser.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/json-glib/json-parser.c b/json-glib/json-parser.c index 655f2e2..6312cf8 100644 --- a/json-glib/json-parser.c +++ b/json-glib/json-parser.c @@ -610,7 +610,8 @@ json_parse_array (JsonParser *parser, array_done: json_scanner_get_next_token (scanner); - json_array_seal (array); + if (priv->is_immutable) + json_array_seal (array); json_node_take_array (priv->current_node, array); if (priv->is_immutable) @@ -791,7 +792,8 @@ json_parse_object (JsonParser *parser, json_scanner_get_next_token (scanner); - json_object_seal (object); + if (priv->is_immutable) + json_object_seal (object); json_node_take_object (priv->current_node, object); if (priv->is_immutable) |