From 385255dcfb36779864151f60a5a4d86d1fb9366d Mon Sep 17 00:00:00 2001 From: "Nathanael d. Noblet" Date: Wed, 1 May 2024 10:42:24 -0600 Subject: [PATCH] Fix memory corruption --- zend/callable.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/zend/callable.h b/zend/callable.h index 89561d5f..21a126d0 100644 --- a/zend/callable.h +++ b/zend/callable.h @@ -232,7 +232,8 @@ class Callable case Type::Array: info->type = (zend_type) ZEND_TYPE_INIT_CODE(IS_ARRAY, arg.allowNull(), _ZEND_ARG_INFO_FLAGS(arg.byReference(), 0, 0)); break; // array of anything (individual members cannot be restricted) case Type::Object: if (arg.classname()) { - info->type = (zend_type) ZEND_TYPE_INIT_CLASS(arg.encoded(), arg.allowNull(), _ZEND_ARG_INFO_FLAGS(arg.byReference(), 0, 0)); + zend_string *className = zend_string_init(arg.encoded(), std::strlen(arg.encoded()), 1); + info->type = (zend_type) ZEND_TYPE_INIT_CLASS(className, arg.allowNull(), _ZEND_ARG_INFO_FLAGS(arg.byReference(), 0, 0)); break; } info->type = (zend_type) ZEND_TYPE_INIT_CODE(IS_OBJECT, arg.allowNull(), _ZEND_ARG_INFO_FLAGS(arg.byReference(), 0, 0));