1
0
mirror of https://github.com/php/php-src.git synced 2026-04-04 06:32:49 +02:00

Merge branch 'PHP-5.6' into PHP-7.0

This commit is contained in:
Nikita Popov
2015-10-09 23:05:49 +02:00
3 changed files with 19 additions and 0 deletions

2
NEWS
View File

@@ -7,6 +7,8 @@ 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
to null). (Nikita)
- Mcrypt:
. Fixed bug #70625 (mcrypt_encrypt() won't return data when no IV was

11
Zend/tests/bug70681.phpt Normal file
View File

@@ -0,0 +1,11 @@
--TEST--
Bug #70681: Segfault when binding $this of internal instance method to null
--FILE--
<?php
$c = (new ReflectionMethod('SplStack', 'count'))->getClosure(new SplStack);
$c = $c->bindTo(null);
?>
--EXPECTF--
Warning: Cannot unbind $this of internal method in %s on line %d

View File

@@ -173,6 +173,12 @@ ZEND_METHOD(Closure, bind)
zend_error(E_WARNING, "Cannot bind an instance to a static closure");
}
if (newthis == NULL && !(closure->func.common.fn_flags & ZEND_ACC_STATIC)
&& closure->func.type == ZEND_INTERNAL_FUNCTION) {
zend_error(E_WARNING, "Cannot unbind $this of internal method");
return;
}
if (scope_arg != NULL) { /* scope argument was given */
if (Z_TYPE_P(scope_arg) == IS_OBJECT) {
ce = Z_OBJCE_P(scope_arg);