diff options
author | Marcus Boerger <helly@php.net> | 2004-06-09 19:25:42 +0000 |
---|---|---|
committer | Marcus Boerger <helly@php.net> | 2004-06-09 19:25:42 +0000 |
commit | 4213153365061f0a2883d9fe63dab493a542872c (patch) | |
tree | 014fa5383d9da746ce6fd102a8c08f8206c85336 /ext/reflection/php_reflection.c | |
parent | f0ffe7c85bf3c83e495cbf2c1ec527068cc59e6d (diff) | |
download | php-git-4213153365061f0a2883d9fe63dab493a542872c.tar.gz |
Fix Bug #28694 ReflectionExtension::getFunctions() crashes PHP
Diffstat (limited to 'ext/reflection/php_reflection.c')
-rw-r--r-- | ext/reflection/php_reflection.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index 9350fb31e8..b5829e3115 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -185,6 +185,7 @@ static void reflection_free_objects_storage(zend_object *object TSRMLS_DC) if (intern->free_ptr && intern->ptr) { efree(intern->ptr); + intern->ptr = NULL; } if (intern->obj) { zval_ptr_dtor(&intern->obj); @@ -221,6 +222,7 @@ static zend_object_value reflection_objects_new(zend_class_entry *class_type TSR intern->zo.in_set = 0; intern->ptr = NULL; intern->obj = NULL; + intern->free_ptr = 0; ALLOC_HASHTABLE(intern->zo.properties); zend_hash_init(intern->zo.properties, 0, NULL, ZVAL_PTR_DTOR, 0); @@ -848,7 +850,7 @@ static void reflection_function_factory(zend_function *function, zval *object TS reflection_instanciate(reflection_function_ptr, object TSRMLS_CC); intern = (reflection_object *) zend_object_store_get_object(object TSRMLS_CC); intern->ptr = function; - intern->free_ptr = function != NULL; + intern->free_ptr = 0; zend_hash_update(Z_OBJPROP_P(object), "name", sizeof("name"), (void **) &name, sizeof(zval *), NULL); } /* }}} */ |