moriyoshi Tue Apr 1 13:44:00 2003 EDT Modified files: /php4/ext/mbstring php_mbregex.c Log: Fixed crash that occurs due to an abused persistent hashtable. # thanks Sascha again. Index: php4/ext/mbstring/php_mbregex.c diff -u php4/ext/mbstring/php_mbregex.c:1.33 php4/ext/mbstring/php_mbregex.c:1.34 --- php4/ext/mbstring/php_mbregex.c:1.33 Tue Mar 4 12:10:29 2003 +++ php4/ext/mbstring/php_mbregex.c Tue Apr 1 13:44:00 2003 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_mbregex.c,v 1.33 2003/03/04 17:10:29 moriyoshi Exp $ */ +/* $Id: php_mbregex.c,v 1.34 2003/04/01 18:44:00 moriyoshi Exp $ */ #ifdef HAVE_CONFIG_H @@ -96,7 +96,6 @@ { 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 @@ /* {{{ _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_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 @@ 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; }
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php