From ad524d2818b2e42d5eebe622db18d07bd6c1fc26 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Wed, 9 Apr 2014 12:16:21 +0400 Subject: [PATCH] Use proper size --- ext/mbstring/mbstring.c | 7 ++++--- 1 file 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++; -- 2.50.1