summaryrefslogtreecommitdiff
path: root/ext/pcre/php_pcre.c
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@php.net>2005-10-11 06:47:48 +0000
committerDmitry Stogov <dmitry@php.net>2005-10-11 06:47:48 +0000
commit631da59b5032cee29081c4a053dc002716769d24 (patch)
tree9b4310403eff76d7d87d7622fa3f0a049bc64c3a /ext/pcre/php_pcre.c
parent062626d03e0d5cd78273c7f0fa65f405790df63c (diff)
downloadphp-git-631da59b5032cee29081c4a053dc002716769d24.tar.gz
Fixed bug #34790 (preg_match_all(), named capturing groups, variable assignment/return => crash)
Diffstat (limited to 'ext/pcre/php_pcre.c')
-rw-r--r--ext/pcre/php_pcre.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c
index ea539803e1..6b45187345 100644
--- a/ext/pcre/php_pcre.c
+++ b/ext/pcre/php_pcre.c
@@ -620,6 +620,7 @@ static void php_pcre_match(INTERNAL_FUNCTION_PARAMETERS, int global)
if (subpat_names[i]) {
zend_hash_update(Z_ARRVAL_P(subpats), subpat_names[i],
strlen(subpat_names[i])+1, &match_sets[i], sizeof(zval *), NULL);
+ ZVAL_ADDREF(match_sets[i]);
}
zend_hash_next_index_insert(Z_ARRVAL_P(subpats), &match_sets[i], sizeof(zval *), NULL);
}