summaryrefslogtreecommitdiff
path: root/ext/mbstring/php_mbregex.c
diff options
context:
space:
mode:
authorMoriyoshi Koizumi <moriyoshi@php.net>2003-04-01 18:44:00 +0000
committerMoriyoshi Koizumi <moriyoshi@php.net>2003-04-01 18:44:00 +0000
commitdf22d1016fdc0350113c5324b886108bf1a4b3cb (patch)
tree4675468b19be9129a37a1e2264f00ecf75e373ac /ext/mbstring/php_mbregex.c
parentb9d53196c20c7a4195a78b6189dafe8f73e1aecb (diff)
downloadphp-git-df22d1016fdc0350113c5324b886108bf1a4b3cb.tar.gz
Fixed crash that occurs due to an abused persistent hashtable.
# thanks Sascha again.
Diffstat (limited to 'ext/mbstring/php_mbregex.c')
-rw-r--r--ext/mbstring/php_mbregex.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/ext/mbstring/php_mbregex.c b/ext/mbstring/php_mbregex.c
index 8d1289a8f7..74246859ae 100644
--- a/ext/mbstring/php_mbregex.c
+++ b/ext/mbstring/php_mbregex.c
@@ -96,7 +96,6 @@ void _php_mb_regex_globals_ctor(zend_mbstring_globals *pglobals TSRMLS_DC)
{
MBSTRG(default_mbctype) = MBCTYPE_EUC;
MBSTRG(current_mbctype) = MBCTYPE_EUC;
- zend_hash_init(&(MBSTRG(ht_rc)), 0, NULL, (void (*)(void *)) php_mb_regex_free_cache, 1);
MBSTRG(search_str) = (zval**)0;
MBSTRG(search_str_val) = (zval*)0;
MBSTRG(search_re) = (mb_regex_t*)0;
@@ -108,7 +107,6 @@ void _php_mb_regex_globals_ctor(zend_mbstring_globals *pglobals TSRMLS_DC)
/* {{{ _php_mb_regex_globals_dtor */
void _php_mb_regex_globals_dtor(zend_mbstring_globals *pglobals TSRMLS_DC)
{
- zend_hash_destroy(&MBSTRG(ht_rc));
}
/* }}} */
@@ -138,6 +136,7 @@ PHP_MSHUTDOWN_FUNCTION(mb_regex)
PHP_RINIT_FUNCTION(mb_regex)
{
MBSTRG(regex_default_options) = MBRE_OPTION_POSIXLINE;
+ zend_hash_init(&(MBSTRG(ht_rc)), 0, NULL, (void (*)(void *)) php_mb_regex_free_cache, 0);
return SUCCESS;
}
@@ -167,7 +166,7 @@ PHP_RSHUTDOWN_FUNCTION(mb_regex)
efree(MBSTRG(search_regs));
MBSTRG(search_regs) = (struct mbre_registers*)0;
}
- zend_hash_clean(&MBSTRG(ht_rc));
+ zend_hash_destroy(&MBSTRG(ht_rc));
return SUCCESS;
}