From: Andrei Zmievski Date: Wed, 23 May 2001 13:54:22 +0000 (+0000) Subject: Fix segfault -- need to copy-construct constant value. X-Git-Tag: PRE_GRANULAR_GARBAGE_FIX~267 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9f0a61955378767328c1fc450f8a893c2b3af6f4;p=php Fix segfault -- need to copy-construct constant value. --- diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c index 0a03a72f0a..d882447ec3 100644 --- a/Zend/zend_builtin_functions.c +++ b/Zend/zend_builtin_functions.c @@ -1016,7 +1016,13 @@ static int add_extension_info(zend_module_entry *module, void *arg) static int add_constant_info(zend_constant *constant, void *arg) { zval *name_array = (zval *)arg; - add_assoc_zval(name_array, constant->name, &(constant->value)); + zval *const_val; + + MAKE_STD_ZVAL(const_val); + *const_val = constant->value; + zval_copy_ctor(const_val); + INIT_PZVAL(const_val); + add_assoc_zval_ex(name_array, constant->name, constant->name_len, const_val); return 0; }