summaryrefslogtreecommitdiff
path: root/ext/json/tests
diff options
context:
space:
mode:
Diffstat (limited to 'ext/json/tests')
-rw-r--r--ext/json/tests/bug72787.phpt15
1 files changed, 15 insertions, 0 deletions
diff --git a/ext/json/tests/bug72787.phpt b/ext/json/tests/bug72787.phpt
new file mode 100644
index 0000000000..c9820faa9f
--- /dev/null
+++ b/ext/json/tests/bug72787.phpt
@@ -0,0 +1,15 @@
+--TEST--
+Bug #72787 (json_decode reads out of bounds)
+--SKIPIF--
+<?php if (!extension_loaded("json")) print "skip"; ?>
+<?php if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only"); ?>
+--FILE--
+<?php
+
+var_dump(json_decode('[]', false, 0x100000000));
+
+?>
+--EXPECTF--
+
+Warning: json_decode(): Depth must be lower than %d in %s on line %d
+NULL