summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikita Popov <nikic@php.net>2015-10-10 15:00:41 +0200
committerNikita Popov <nikic@php.net>2015-10-10 15:00:41 +0200
commitc85ad5d0be8a629e9bfeb1235447b0308663abae (patch)
treec4eef067e0ea8a487ff2c9d6fd12e82efee07f3e
parent4b821f0fc6aade0eb9793a8b4fa3cd28b347ac2f (diff)
parentd7d01fc9a326fe530df4e067db1df9ec451f4411 (diff)
downloadphp-git-c85ad5d0be8a629e9bfeb1235447b0308663abae.tar.gz
Merge branch 'PHP-5.6' into PHP-7.0
Conflicts: Zend/zend_closures.c
-rw-r--r--NEWS4
-rw-r--r--Zend/tests/bug70685.phpt22
2 files changed, 25 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index 4d2b9ba8c4..7011de484c 100644
--- a/NEWS
+++ b/NEWS
@@ -7,8 +7,10 @@ PHP NEWS
getClosure()). (Dmitry, Bob)
. Fixed bug #70662 (Duplicate array key via undefined index error handler).
(Nikita)
- . Fixed buf #70681 (Segfault when binding $this of internal instance method
+ . Fixed bug #70681 (Segfault when binding $this of internal instance method
to null). (Nikita)
+ . Fixed bug #70685 (Segfault for getClosure() internal method rebind with
+ invalid $this). (Nikita)
- Mcrypt:
. Fixed bug #70625 (mcrypt_encrypt() won't return data when no IV was
diff --git a/Zend/tests/bug70685.phpt b/Zend/tests/bug70685.phpt
new file mode 100644
index 0000000000..e286e58e7d
--- /dev/null
+++ b/Zend/tests/bug70685.phpt
@@ -0,0 +1,22 @@
+--TEST--
+Bug #70685: Segfault for getClosure() internal method rebind with invalid $this
+--FILE--
+<?php
+
+class cls {}
+
+$c = (new ReflectionMethod('SplStack', 'count'))->getClosure(new SplStack);
+$c = $c->bindTo(new cls);
+var_dump($c);
+
+$c = (new ReflectionMethod('SplStack', 'count'))->getClosure(new SplStack);
+$c = $c->bindTo(new SplStack, 'cls');
+var_dump($c);
+
+?>
+--EXPECTF--
+Warning: Cannot bind internal method SplDoublyLinkedList::count() to object of class cls in %s on line %d
+NULL
+
+Warning: Cannot bind function SplDoublyLinkedList::count to scope class cls in %s on line %d
+NULL