com php-src: Use proper size: ext/mbstring/mbstring.c
| From: | Dmitry Stogov | Date: | Wed, 09 Apr 2014 08:16:21 +0000 |
| Subject: | com php-src: Use proper size: ext/mbstring/mbstring.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-77464@lists.php.net to get a copy of this message | ||
Commit: ad524d2818b2e42d5eebe622db18d07bd6c1fc26
Author: Dmitry Stogov <dmitry@zend.com> Wed, 9 Apr 2014 12:16:21 +0400
Parents: 48d3b95aee6096aa5a005469ab20c64e6d316fdf
Branches: phpng
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=ad524d2818b2e42d5eebe622db18d07bd6c1fc26
Log:
Use proper size
Changed paths:
M ext/mbstring/mbstring.c
Diff:
diff --git a/ext/mbstring/mbstring.c b/ext/mbstring/mbstring.c
index a464b1c..c7feb1f 100644
--- a/ext/mbstring/mbstring.c
+++ b/ext/mbstring/mbstring.c
@@ -1614,9 +1614,10 @@ PHP_RINIT_FUNCTION(mbstring)
php_error_docref("ref.mbstring" TSRMLS_CC, E_WARNING, "mbstring couldn't
find function %s.", p->orig_func);
return FAILURE;
} else {
- zend_hash_str_add_mem(EG(function_table), p->save_func, strlen(p->save_func), orig,
sizeof(zend_function));
+ ZEND_ASSERT(orig->type == ZEND_INTERNAL_FUNCTION);
+ zend_hash_str_add_mem(EG(function_table), p->save_func, strlen(p->save_func), orig,
sizeof(zend_internal_function));
- if (zend_hash_str_update_mem(EG(function_table), p->orig_func, strlen(p->orig_func),
func, sizeof(zend_function)) == NULL) {
+ if (zend_hash_str_update_mem(EG(function_table), p->orig_func, strlen(p->orig_func),
func, sizeof(zend_internal_function)) == NULL) {
php_error_docref("ref.mbstring" TSRMLS_CC, E_WARNING, "mbstring couldn't
replace function %s.", p->orig_func);
return FAILURE;
}
@@ -1665,7 +1666,7 @@ PHP_RSHUTDOWN_FUNCTION(mbstring)
if ((MBSTRG(func_overload) & p->type) == p->type &&
(orig = zend_hash_str_find_ptr(EG(function_table), p->save_func, strlen(p->save_func))))
{
- zend_hash_str_update_mem(EG(function_table), p->orig_func, strlen(p->orig_func), orig,
sizeof(zend_function));
+ zend_hash_str_update_mem(EG(function_table), p->orig_func, strlen(p->orig_func), orig,
sizeof(zend_internal_function));
zend_hash_str_del(EG(function_table), p->save_func, strlen(p->save_func));
}
p++;