diff options
| author | Sean Finney <seanius@debian.org> | 2009-04-10 14:09:48 +0200 |
|---|---|---|
| committer | Sean Finney <seanius@debian.org> | 2009-04-10 14:09:48 +0200 |
| commit | cd0b49c72aee33b3e44a9c589fcd93b9e1c7a64f (patch) | |
| tree | 1315c623bb7d9dfa8d366fa9cd2c6834ceeb5da5 /ext/json/JSON_parser.c | |
| parent | 9ea47aab740772adf0c69d8c94b208a464e599ea (diff) | |
| download | php-upstream/5.2.9.dfsg.1.tar.gz | |
Imported Upstream version 5.2.9.dfsg.1upstream/5.2.9.dfsg.1
Diffstat (limited to 'ext/json/JSON_parser.c')
| -rw-r--r-- | ext/json/JSON_parser.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/ext/json/JSON_parser.c b/ext/json/JSON_parser.c index c054d5038..a88dde9fa 100644 --- a/ext/json/JSON_parser.c +++ b/ext/json/JSON_parser.c @@ -201,7 +201,7 @@ static const int state_transition_table[30][31] = { /*29*/ {29,29,-1,-1,-1,-1,-1,-1, 3,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1} }; -#define JSON_PARSER_MAX_DEPTH 128 +#define JSON_PARSER_MAX_DEPTH 512 /* @@ -285,7 +285,7 @@ static void json_create_zval(zval **z, smart_str *buf, int type) if (type == IS_LONG) { double d = zend_strtod(buf->c, NULL); - if (d > LONG_MAX || d < -LONG_MAX) { + if (d > LONG_MAX || d < LONG_MIN) { ZVAL_DOUBLE(*z, d); } else { ZVAL_LONG(*z, (long)d); @@ -494,9 +494,7 @@ JSON_parser(zval *z, unsigned short p[], int length, int assoc TSRMLS_DC) } */ case -7: - if (type != -1 && - (JSON(the_stack)[JSON(the_top)] == MODE_OBJECT || - JSON(the_stack)[JSON(the_top)] == MODE_ARRAY)) + if (type != -1 && JSON(the_stack)[JSON(the_top)] == MODE_OBJECT) { zval *mval; smart_str_0(&buf); @@ -566,9 +564,7 @@ JSON_parser(zval *z, unsigned short p[], int length, int assoc TSRMLS_DC) */ case -5: { - if (type != -1 && - (JSON(the_stack)[JSON(the_top)] == MODE_OBJECT || - JSON(the_stack)[JSON(the_top)] == MODE_ARRAY)) + if (type != -1 && JSON(the_stack)[JSON(the_top)] == MODE_ARRAY) { zval *mval; smart_str_0(&buf); |
