com php-src: Fix bug #69448: ext/reflection/php_reflection. c
| From: | Levi Morrison | Date: | Tue, 14 Apr 2015 15:45:41 +0000 |
| Subject: | com php-src: Fix bug #69448: ext/reflection/php_reflection. c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-86236@lists.php.net to get a copy of this message | ||
Commit: dad622bf42eaba151a2558f0d59b3a06e1a444b9
Author: Levi Morrison <levim@php.net> Tue, 14 Apr 2015 09:45:41 -0600
Parents: 8dfb35eae0cd900de0537614e1ee2afb55794560
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=dad622bf42eaba151a2558f0d59b3a06e1a444b9
Log:
Fix bug #69448
ReflectionClass::newInstanceWithoutConstructor should not call
object_init_ex when the class is internal and final. This is because
the class dtor may rely on the ctor being called and in some cases
this will cause a segfault.
Bugs:
https://bugs.php.net/69448
Changed paths:
M ext/reflection/php_reflection.c
Diff:
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c
index 47cf107..bec69b2 100644
--- a/ext/reflection/php_reflection.c
+++ b/ext/reflection/php_reflection.c
@@ -4315,6 +4315,7 @@ ZEND_METHOD(reflection_class, newInstanceWithoutConstructor)
if (ce->create_object != NULL && ce->ce_flags & ZEND_ACC_FINAL) {
zend_throw_exception_ex(reflection_exception_ptr, 0, "Class %s is an internal class marked
as final that cannot be instantiated without invoking its constructor", ce->name->val);
+ return;
}
object_init_ex(return_value, ce);