com php-src: better fix for #63055: Zend/zend_variables.c ext/pcre/php_pcre.c
| From: | Xinchen Hui | Date: | Thu, 18 Oct 2012 12:10:35 +0000 |
| Subject: | com php-src: better fix for #63055: Zend/zend_variables.c ext/pcre/php_pcre.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-70421@lists.php.net to get a copy of this message | ||
Commit: e88cdaa0143aacd2d765eb0560452ea28e327e41
Author: Xinchen Hui <laruence@php.net> Thu, 18 Oct 2012 20:10:35 +0800
Parents: 8bd5e15ff7a57791956c4017ee8fb4a8ac0d8d2e
Branches: PHP-5.3
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=e88cdaa0143aacd2d765eb0560452ea28e327e41
Log:
better fix for #63055
Bugs:
https://bugs.php.net/63055
Changed paths:
M Zend/zend_variables.c
M ext/pcre/php_pcre.c
Diff:
diff --git a/Zend/zend_variables.c b/Zend/zend_variables.c
index c790108..2b2ca0f 100644
--- a/Zend/zend_variables.c
+++ b/Zend/zend_variables.c
@@ -40,6 +40,8 @@ ZEND_API void _zval_dtor_func(zval *zvalue ZEND_FILE_LINE_DC)
TSRMLS_FETCH();
if (zvalue->value.ht && (zvalue->value.ht != &EG(symbol_table))) {
+ /* break possible cycles */
+ Z_TYPE_P(zvalue) = IS_NULL;
zend_hash_destroy(zvalue->value.ht);
FREE_HASHTABLE(zvalue->value.ht);
}
diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c
index 1af8151..736a708 100644
--- a/ext/pcre/php_pcre.c
+++ b/ext/pcre/php_pcre.c
@@ -547,9 +547,8 @@ PHPAPI void php_pcre_match_impl(pcre_cache_entry *pce, char *subject, int subjec
/* Overwrite the passed-in value for subpatterns with an empty array. */
if (subpats != NULL) {
- zval garbage = *subpats;
+ zval_dtor(subpats);
array_init(subpats);
- zval_dtor(&garbage);
}
subpats_order = global ? PREG_PATTERN_ORDER : 0;