]> granicus.if.org Git - php/commitdiff
add test for bug #70898
authorAnatol Belski <ab@php.net>
Thu, 12 Nov 2015 08:28:10 +0000 (09:28 +0100)
committerAnatol Belski <ab@php.net>
Thu, 12 Nov 2015 08:28:10 +0000 (09:28 +0100)
Zend/tests/bug70898.phpt [new file with mode: 0644]

diff --git a/Zend/tests/bug70898.phpt b/Zend/tests/bug70898.phpt
new file mode 100644 (file)
index 0000000..6308ddc
--- /dev/null
@@ -0,0 +1,22 @@
+--TEST--
+Bug #70895 null ptr deref and segfault with crafted calable
+--FILE--
+<?php 
+       function m($f,$a){
+               return array_map($f,0);
+       }
+
+       echo implode(m("",m("",m("",m("",m("0000000000000000000000000000000000",("")))))));
+?>
+--EXPECTF--
+Warning: array_map() expects parameter 1 to be a valid callback, function '0000000000000000000000000000000000' not found or invalid function name in %sbug70898.php on line %d
+
+Warning: array_map() expects parameter 1 to be a valid callback, function '' not found or invalid function name in %sbug70898.php on line %d
+
+Warning: array_map() expects parameter 1 to be a valid callback, function '' not found or invalid function name in %sbug70898.php on line %d
+
+Warning: array_map() expects parameter 1 to be a valid callback, function '' not found or invalid function name in %sbug70898.php on line %d
+
+Warning: array_map() expects parameter 1 to be a valid callback, function '' not found or invalid function name in %sbug70898.php on line %d
+
+Warning: implode(): Argument must be an array in %sbug70898.php on line %d