Skip to content

Commit

Permalink
Fixed bug #32981 (ReflectionMethod::getStaticVariables() causes apach…
Browse files Browse the repository at this point in the history
…e2.0.54 seg fault)
  • Loading branch information
dstogov committed Aug 17, 2005
1 parent 4f07d5a commit 79fcfd2
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions NEWS
Expand Up @@ -76,6 +76,8 @@ PHP NEWS
- Fixed bug #33017 ("make distclean" gives an error with VPATH build). (Jani)
- Fixed bug #33013 ("next month" was handled wrong while parsing dates).
(Derick)
- Fixed bug #32981 (ReflectionMethod::getStaticVariables() causes apache2.0.54
seg fault). (Dmitry)
- Fixed bug #32956 (mysql_bind_result() doesn't support MYSQL_TYPE_NULL). (Georg)
- Fixed bug #32947 (Incorrect option for mysqli default password). (Georg)
- Fixed bug #32944 (Disabling session.use_cookies doesn't prevent reading
Expand Down
1 change: 1 addition & 0 deletions Zend/zend_reflection_api.c
Expand Up @@ -1335,6 +1335,7 @@ ZEND_METHOD(reflection_function, getStaticVariables)
/* Return an empty array in case no static variables exist */
array_init(return_value);
if (fptr->type == ZEND_USER_FUNCTION && fptr->op_array.static_variables != NULL) {
zend_hash_apply_with_argument(fptr->op_array.static_variables, (apply_func_arg_t) zval_update_constant, (void*)1 TSRMLS_CC);
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 *));
}
}
Expand Down
1 change: 1 addition & 0 deletions ext/reflection/php_reflection.c
Expand Up @@ -1335,6 +1335,7 @@ ZEND_METHOD(reflection_function, getStaticVariables)
/* Return an empty array in case no static variables exist */
array_init(return_value);
if (fptr->type == ZEND_USER_FUNCTION && fptr->op_array.static_variables != NULL) {
zend_hash_apply_with_argument(fptr->op_array.static_variables, (apply_func_arg_t) zval_update_constant, (void*)1 TSRMLS_CC);
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 *));
}
}
Expand Down
2 changes: 1 addition & 1 deletion ext/reflection/tests/bug32981.phpt
Expand Up @@ -28,7 +28,7 @@ array(1) {
[0]=>
array(1) {
["enabled"]=>
UNKNOWN:0
bool(true)
}
}
===DONE===

0 comments on commit 79fcfd2

Please sign in to comment.