[php-src] Issue #10217: INIT_OVERLOADED_CLASS_ENTRY uses sizeof() to determine class name length

From: Date: Wed, 04 Jan 2023 12:27:25 +0000
Subject: [php-src] Issue #10217: INIT_OVERLOADED_CLASS_ENTRY uses sizeof() to determine class name length
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-243330@lists.php.net to get a copy of this message
Issue: https://github.com/php/php-src/issues/10217 Author: dbuteyn ### Description This works: ```C INIT_CLASS_ENTRY(ce, "mylongclassname", methods); ``` This does not: ```C void register_class(zend_class_entry * ce, const char * name, const zend_function_entry * methods) { INIT_CLASS_ENTRY(ce, name, methods); } register_class(ce, "mylongclassname", methods); ``` Because INIT_OVERLOADED_CLASS_ENTRY uses sizeof() to determine class_name_len: ```C #define INIT_OVERLOADED_CLASS_ENTRY(class_container, class_name, functions, handle_fcall, handle_propget, handle_propset) \ INIT_OVERLOADED_CLASS_ENTRY_EX(class_container, class_name, sizeof(class_name)-1, functions, handle_fcall, handle_propget, handle_propset, NULL, NULL ``` ### PHP Version All ### Operating System All

« previous php.bugs (#243330) next »