Browse Source

- Fix crash in reflection API (pierre)

PEAR_1_4DEV
Andi Gutmans 23 years ago
parent
commit
0f1382e126
  1. 12
      Zend/zend_reflection_api.c
  2. 12
      ext/reflection/php_reflection.c

12
Zend/zend_reflection_api.c

@ -1612,15 +1612,19 @@ ZEND_METHOD(reflection_method, invoke)
object_pp = NULL;
obj_ce = NULL;
} else {
obj_ce = Z_OBJCE_PP(params[0]);
if ((Z_TYPE_PP(params[0]) != IS_OBJECT)
|| (!instanceof_function(obj_ce, mptr->common.scope TSRMLS_CC))) {
if ((Z_TYPE_PP(params[0]) != IS_OBJECT)) {
efree(params);
_DO_THROW("Non-object passed to Invoke()");
/* Returns from this function */
}
obj_ce = Z_OBJCE_PP(params[0]);
if (!instanceof_function(obj_ce, mptr->common.scope TSRMLS_CC)) {
_DO_THROW("Given object is not an instance of the class this method was declared in");
/* Returns from this function */
}
object_pp = params[0];
}

12
ext/reflection/php_reflection.c

@ -1612,15 +1612,19 @@ ZEND_METHOD(reflection_method, invoke)
object_pp = NULL;
obj_ce = NULL;
} else {
obj_ce = Z_OBJCE_PP(params[0]);
if ((Z_TYPE_PP(params[0]) != IS_OBJECT)
|| (!instanceof_function(obj_ce, mptr->common.scope TSRMLS_CC))) {
if ((Z_TYPE_PP(params[0]) != IS_OBJECT)) {
efree(params);
_DO_THROW("Non-object passed to Invoke()");
/* Returns from this function */
}
obj_ce = Z_OBJCE_PP(params[0]);
if (!instanceof_function(obj_ce, mptr->common.scope TSRMLS_CC)) {
_DO_THROW("Given object is not an instance of the class this method was declared in");
/* Returns from this function */
}
object_pp = params[0];
}

Loading…
Cancel
Save