com php-src: Fix dynamic calls to static methods with fci->object: Zend/zend_execute_API.c
| From: | Nikita Popov | Date: | Sun, 05 Oct 2014 21:11:17 +0000 |
| Subject: | com php-src: Fix dynamic calls to static methods with fci->object: Zend/zend_execute_API.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-82116@lists.php.net to get a copy of this message | ||
Commit: 9bc14f9632739274d7d3430759f77f272bf63241
Author: Nikita Popov <nikic@php.net> Sun, 5 Oct 2014 23:11:17 +0200
Parents: fb34cd90f8a26d32f4eab179c4192d13a87c856c
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=9bc14f9632739274d7d3430759f77f272bf63241
Log:
Fix dynamic calls to static methods with fci->object
func may already be freed at the time the static flag was checked.
Changed paths:
M Zend/zend_execute_API.c
Diff:
diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c
index 9fdb2ee..1da64bb 100644
--- a/Zend/zend_execute_API.c
+++ b/Zend/zend_execute_API.c
@@ -829,8 +829,10 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache
TS
call->num_args = fci->param_count;
EG(scope) = calling_scope;
- if (!fci->object ||
- (func->common.fn_flags & ZEND_ACC_STATIC)) {
+ if (func->common.fn_flags & ZEND_ACC_STATIC) {
+ fci->object = NULL;
+ }
+ if (!fci->object) {
Z_OBJ(call->This) = NULL;
Z_TYPE_INFO(call->This) = IS_UNDEF;
} else {
@@ -908,7 +910,7 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS
}
}
- if (fci->object && !(func->common.fn_flags & ZEND_ACC_STATIC)) {
+ if (fci->object) {
OBJ_RELEASE(fci->object);
}