diff options
author | Erik Michaels-Ober <sferik@gmail.com> | 2012-10-05 09:11:36 -0700 |
---|---|---|
committer | Erik Michaels-Ober <sferik@gmail.com> | 2012-10-05 09:11:51 -0700 |
commit | 9f43acbaff619d813b5a96b7e303b4876dbdf9b9 (patch) | |
tree | 4bfbbf8dc3e2f14efe8fda5e41c2f44e59dd4429 /ext/json | |
parent | 01a5165bee5c8cf199e37b3ccc90f1f824d41783 (diff) | |
download | json-9f43acbaff619d813b5a96b7e303b4876dbdf9b9.tar.gz |
Increase default max_nesting to 100
See discussion at https://github.com/intridea/multi_json/pull/59.
Diffstat (limited to 'ext/json')
-rw-r--r-- | ext/json/ext/generator/generator.c | 4 | ||||
-rw-r--r-- | ext/json/ext/parser/parser.c | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/ext/json/ext/generator/generator.c b/ext/json/ext/generator/generator.c index 3cff87d..ad7dfe3 100644 --- a/ext/json/ext/generator/generator.c +++ b/ext/json/ext/generator/generator.c @@ -558,7 +558,7 @@ static VALUE cState_configure(VALUE self, VALUE opts) state->object_nl_len = len; } tmp = ID2SYM(i_max_nesting); - state->max_nesting = 19; + state->max_nesting = 100; if (option_given_p(opts, tmp)) { VALUE max_nesting = rb_hash_aref(opts, tmp); if (RTEST(max_nesting)) { @@ -908,7 +908,7 @@ static VALUE cState_initialize(int argc, VALUE *argv, VALUE self) { VALUE opts; GET_STATE(self); - state->max_nesting = 19; + state->max_nesting = 100; state->buffer_initial_length = FBUFFER_INITIAL_LENGTH_DEFAULT; rb_scan_args(argc, argv, "01", &opts); if (!NIL_P(opts)) cState_configure(self, opts); diff --git a/ext/json/ext/parser/parser.c b/ext/json/ext/parser/parser.c index c140fdb..8442d21 100644 --- a/ext/json/ext/parser/parser.c +++ b/ext/json/ext/parser/parser.c @@ -1618,7 +1618,7 @@ static VALUE convert_encoding(VALUE source) * _opts_ can have the following keys: * * *max_nesting*: The maximum depth of nesting allowed in the parsed data * structures. Disable depth checking with :max_nesting => false|nil|0, it - * defaults to 19. + * defaults to 100. * * *allow_nan*: If set to true, allow NaN, Infinity and -Infinity in * defiance of RFC 4627 to be parsed by the Parser. This option defaults to * false. @@ -1655,7 +1655,7 @@ static VALUE cParser_initialize(int argc, VALUE *argv, VALUE self) json->max_nesting = 0; } } else { - json->max_nesting = 19; + json->max_nesting = 100; } tmp = ID2SYM(i_allow_nan); if (option_given_p(opts, tmp)) { @@ -1709,7 +1709,7 @@ static VALUE cParser_initialize(int argc, VALUE *argv, VALUE self) } } } else { - json->max_nesting = 19; + json->max_nesting = 100; json->allow_nan = 0; json->create_additions = 1; json->create_id = rb_funcall(mJSON, i_create_id, 0); |