diff options
Diffstat (limited to 'ext/json')
-rw-r--r-- | ext/json/json.c | 10 | ||||
-rw-r--r-- | ext/json/json_encoder.c | 2 | ||||
-rw-r--r-- | ext/json/json_parser.y | 2 | ||||
-rw-r--r-- | ext/json/json_scanner.re | 2 | ||||
-rw-r--r-- | ext/json/php_json.h | 2 | ||||
-rw-r--r-- | ext/json/php_json_encoder.h | 2 | ||||
-rw-r--r-- | ext/json/php_json_parser.h | 2 | ||||
-rw-r--r-- | ext/json/php_json_scanner.h | 2 | ||||
-rw-r--r-- | ext/json/tests/bug68817.phpt | 17 |
9 files changed, 33 insertions, 8 deletions
diff --git a/ext/json/json.c b/ext/json/json.c index 7db6136e87..b1de42a577 100644 --- a/ext/json/json.c +++ b/ext/json/json.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2014 The PHP Group | + | Copyright (c) 1997-2015 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -32,6 +32,14 @@ #include "php_json_parser.h" #include <zend_exceptions.h> +#include <float.h> +#if defined(DBL_MANT_DIG) && defined(DBL_MIN_EXP) +#define NUM_BUF_SIZE (3 + DBL_MANT_DIG - DBL_MIN_EXP) +#else +#define NUM_BUF_SIZE 1080 +#endif + + static PHP_MINFO_FUNCTION(json); static PHP_FUNCTION(json_encode); static PHP_FUNCTION(json_decode); diff --git a/ext/json/json_encoder.c b/ext/json/json_encoder.c index 5eb9f45573..d7d226db85 100644 --- a/ext/json/json_encoder.c +++ b/ext/json/json_encoder.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2014 The PHP Group | + | Copyright (c) 1997-2015 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/json/json_parser.y b/ext/json/json_parser.y index 1de6d6c747..72f2890f6f 100644 --- a/ext/json/json_parser.y +++ b/ext/json/json_parser.y @@ -3,7 +3,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2014 The PHP Group | + | Copyright (c) 1997-2015 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/json/json_scanner.re b/ext/json/json_scanner.re index b2add4b191..28743e5453 100644 --- a/ext/json/json_scanner.re +++ b/ext/json/json_scanner.re @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2014 The PHP Group | + | Copyright (c) 1997-2015 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/json/php_json.h b/ext/json/php_json.h index 2a26b97181..569239a5c0 100644 --- a/ext/json/php_json.h +++ b/ext/json/php_json.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2014 The PHP Group | + | Copyright (c) 1997-2015 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/json/php_json_encoder.h b/ext/json/php_json_encoder.h index db81262a02..357994e512 100644 --- a/ext/json/php_json_encoder.h +++ b/ext/json/php_json_encoder.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2014 The PHP Group | + | Copyright (c) 1997-2015 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/json/php_json_parser.h b/ext/json/php_json_parser.h index 08c3ee1287..ec20950aa3 100644 --- a/ext/json/php_json_parser.h +++ b/ext/json/php_json_parser.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2014 The PHP Group | + | Copyright (c) 1997-2015 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/json/php_json_scanner.h b/ext/json/php_json_scanner.h index fbf65eac70..4b031a4f12 100644 --- a/ext/json/php_json_scanner.h +++ b/ext/json/php_json_scanner.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2014 The PHP Group | + | Copyright (c) 1997-2015 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/json/tests/bug68817.phpt b/ext/json/tests/bug68817.phpt new file mode 100644 index 0000000000..aa9a63f93d --- /dev/null +++ b/ext/json/tests/bug68817.phpt @@ -0,0 +1,17 @@ +--TEST-- +Bug #68817 (Null pointer deference) +--SKIPIF-- +<?php if (!extension_loaded("json")) print "skip"; ?> +--FILE-- +<?php + +var_dump(json_decode('[""]')); + +?> +===DONE=== +--EXPECTF-- +array(1) { + [0]=> + string(0) "" +} +===DONE=== |