com php-src: Fixed Issue #1400 (double free static property): Zend/zend_inheritance.c
| From: | Xinchen Hui | Date: | Fri, 10 Jul 2015 07:27:06 +0000 |
| Subject: | com php-src: Fixed Issue #1400 (double free static property): Zend/zend_inheritance.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-87898@lists.php.net to get a copy of this message | ||
Commit: a3f05d640d73d61c1978446adb1217f40356d037
Author: Xinchen Hui <laruence@php.net> Fri, 10 Jul 2015 15:27:06 +0800
Parents: ef1b588f6a39bcc2c0d5fad9f2094bb011aeaf0b
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=a3f05d640d73d61c1978446adb1217f40356d037
Log:
Fixed Issue #1400 (double free static property)
Bugs:
https://bugs.php.net/1400
Changed paths:
M Zend/zend_inheritance.c
Diff:
diff --git a/Zend/zend_inheritance.c b/Zend/zend_inheritance.c
index 64e7407..9b96a4a 100644
--- a/Zend/zend_inheritance.c
+++ b/Zend/zend_inheritance.c
@@ -821,7 +821,13 @@ ZEND_API void zend_do_inheritance(zend_class_entry *ce, zend_class_entry
*parent
do {
dst--;
src--;
- ZVAL_MAKE_REF(src);
+ if (parent_ce->type == ZEND_INTERNAL_CLASS) {
+ if (!Z_ISREF_P(src)) {
+ ZVAL_NEW_PERSISTENT_REF(src, src);
+ }
+ } else {
+ ZVAL_MAKE_REF(src);
+ }
ZVAL_COPY_VALUE(dst, src);
Z_ADDREF_P(dst);
if (Z_CONSTANT_P(Z_REFVAL_P(dst))) {