diff options
author | Andi Gutmans <andi@php.net> | 2004-03-01 15:19:38 +0000 |
---|---|---|
committer | Andi Gutmans <andi@php.net> | 2004-03-01 15:19:38 +0000 |
commit | 0f1382e1266ddac4727971f1121d0b8f6da7df98 (patch) | |
tree | e8180a34c906eba75fae9ce3bce36efdd789e94a /ext/reflection/php_reflection.c | |
parent | 7c72f6ff6161b2fd0421b5de240321e2ca032d13 (diff) | |
download | php-git-0f1382e1266ddac4727971f1121d0b8f6da7df98.tar.gz |
- Fix crash in reflection API (pierre)
Diffstat (limited to 'ext/reflection/php_reflection.c')
-rw-r--r-- | ext/reflection/php_reflection.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index c71044df04..4b5c9b4167 100644 --- a/ext/reflection/php_reflection.c +++ b/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]; } |