diff options
author | Antony Dovgal <tony2001@php.net> | 2008-03-06 17:28:26 +0000 |
---|---|---|
committer | Antony Dovgal <tony2001@php.net> | 2008-03-06 17:28:26 +0000 |
commit | cbdc4b9af82b786a1a0f56fa2452d7a8dfdb7691 (patch) | |
tree | 028d27f7a326b5599aa74c9652cea548ba93b582 /Zend/zend_API.c | |
parent | ee0f7bc0ac34ea6b96650bb7715517372d2af711 (diff) | |
download | php-git-cbdc4b9af82b786a1a0f56fa2452d7a8dfdb7691.tar.gz |
fix segfault when trying to clone uncloneable object because of zend.ze1_compatibility_mode which we should have got rid of years ago
Diffstat (limited to 'Zend/zend_API.c')
-rw-r--r-- | Zend/zend_API.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Zend/zend_API.c b/Zend/zend_API.c index 192c4709a1..cfa354a8d5 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -168,9 +168,15 @@ ZEND_API int _zend_get_parameters_array_ex(int param_count, zval ***argument_arr *value_ptr = **value; INIT_PZVAL(value_ptr); zend_error(E_STRICT, "Implicit cloning object of class '%s' because of 'zend.ze1_compatibility_mode'", class_name); + + if (Z_OBJ_HANDLER_PP(value, clone_obj) == NULL) { + zend_error(E_CORE_ERROR, "Trying to clone uncloneable object of class %s", class_name); + } + if(!dup) { efree(class_name); } + value_ptr->value.obj = Z_OBJ_HANDLER_PP(value, clone_obj)(*value TSRMLS_CC); zval_ptr_dtor(value); *value = value_ptr; |