diff options
author | Dmitry Stogov <dmitry@zend.com> | 2014-04-09 12:16:21 +0400 |
---|---|---|
committer | Dmitry Stogov <dmitry@zend.com> | 2014-04-09 12:16:21 +0400 |
commit | ad524d2818b2e42d5eebe622db18d07bd6c1fc26 (patch) | |
tree | ef59d781caf70a0aff8fdac27546e04f6dda55e9 | |
parent | 48d3b95aee6096aa5a005469ab20c64e6d316fdf (diff) | |
download | php-git-ad524d2818b2e42d5eebe622db18d07bd6c1fc26.tar.gz |
Use proper size
-rw-r--r-- | ext/mbstring/mbstring.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/ext/mbstring/mbstring.c b/ext/mbstring/mbstring.c index a464b1c5c7..c7feb1f293 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++; |