From d763f167d8790043df2bac8f981a3c11541d1281 Mon Sep 17 00:00:00 2001 From: Antony Dovgal Date: Wed, 22 May 2019 16:53:39 +0300 Subject: [PATCH] fix incorrect type alloc that causes memory corruption --- lua_closure.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua_closure.c b/lua_closure.c index b9789e2..90f92a4 100644 --- a/lua_closure.c +++ b/lua_closure.c @@ -75,7 +75,7 @@ PHP_METHOD(lua_closure, invoke) { zval rv; if (ZEND_NUM_ARGS()) { - arguments = emalloc(sizeof(zval*) * ZEND_NUM_ARGS()); + arguments = emalloc(sizeof(zval) * ZEND_NUM_ARGS()); if (zend_get_parameters_array_ex(ZEND_NUM_ARGS(), arguments) == FAILURE) { efree(arguments); zend_throw_exception_ex(NULL, 0, "cannot get arguments for calling closure");