Merge branch 'PHP-7.4'

This commit is contained in:
Nikita Popov 2019-10-09 17:01:02 +02:00
commit efed9f6b15
2 changed files with 15 additions and 1 deletions

14
Zend/tests/bug78658.phpt Normal file
View file

@ -0,0 +1,14 @@
--TEST--
Bug #78658: Memory corruption using Closure::bindTo()
--FILE--
<?php
$c = function(){};
$scope = "AAAA";
$scope = "{$scope}BBBB";
$c->bindTo(new stdClass, $scope);
?>
--EXPECTF--
Warning: Class 'AAAABBBB' not found in %s on line %d

View file

@ -212,7 +212,7 @@ ZEND_METHOD(Closure, bind)
ce = closure->func.common.scope; ce = closure->func.common.scope;
} else if ((ce = zend_lookup_class(class_name)) == NULL) { } else if ((ce = zend_lookup_class(class_name)) == NULL) {
zend_error(E_WARNING, "Class '%s' not found", ZSTR_VAL(class_name)); zend_error(E_WARNING, "Class '%s' not found", ZSTR_VAL(class_name));
zend_string_release_ex(class_name, 0); zend_tmp_string_release(tmp_class_name);
RETURN_NULL(); RETURN_NULL();
} }
zend_tmp_string_release(tmp_class_name); zend_tmp_string_release(tmp_class_name);