]> granicus.if.org Git - php/commitdiff
- Bugix #30783: Apache crash when using ReflectionFunction::getStaticVariables()
authorMarcus Boerger <helly@php.net>
Sun, 14 Nov 2004 18:01:44 +0000 (18:01 +0000)
committerMarcus Boerger <helly@php.net>
Sun, 14 Nov 2004 18:01:44 +0000 (18:01 +0000)
Zend/zend_reflection_api.c
ext/reflection/php_reflection.c

index f19e0b72a96072fa8ee5c3f2643c5652dbb07e8e..771d4101a42ad56ab1d6c0749b300c060712c03c 100644 (file)
@@ -1331,7 +1331,7 @@ ZEND_METHOD(reflection_function, getStaticVariables)
 
        /* Return an empty array in case no static variables exist */
        array_init(return_value);
-       if (fptr->op_array.static_variables != NULL) {
+       if (fptr->type == ZEND_USER_FUNCTION && fptr->op_array.static_variables != NULL) {
                zend_hash_copy(Z_ARRVAL_P(return_value), fptr->op_array.static_variables, (copy_ctor_func_t) zval_add_ref, (void *) &tmp_copy, sizeof(zval *));
        }
 }
index f19e0b72a96072fa8ee5c3f2643c5652dbb07e8e..771d4101a42ad56ab1d6c0749b300c060712c03c 100644 (file)
@@ -1331,7 +1331,7 @@ ZEND_METHOD(reflection_function, getStaticVariables)
 
        /* Return an empty array in case no static variables exist */
        array_init(return_value);
-       if (fptr->op_array.static_variables != NULL) {
+       if (fptr->type == ZEND_USER_FUNCTION && fptr->op_array.static_variables != NULL) {
                zend_hash_copy(Z_ARRVAL_P(return_value), fptr->op_array.static_variables, (copy_ctor_func_t) zval_add_ref, (void *) &tmp_copy, sizeof(zval *));
        }
 }