diff options
| author | Antony Dovgal <tony2001@php.net> | 2007-04-27 08:12:24 +0000 |
|---|---|---|
| committer | Antony Dovgal <tony2001@php.net> | 2007-04-27 08:12:24 +0000 |
| commit | de4f3007e2eebe6c08679ababe94410c0b8ed41e (patch) | |
| tree | 5905f271a385849c5cf0b263f3e5dfd9a69fdf82 /Zend/zend_execute_API.c | |
| parent | 88bef568da7180b0a5303a814f02f5549c27620e (diff) | |
| download | php-git-de4f3007e2eebe6c08679ababe94410c0b8ed41e.tar.gz | |
MFH: initialize retval_ptr_ptr before returning FAILURE
this fixes invalid read in #41209
Diffstat (limited to 'Zend/zend_execute_API.c')
| -rw-r--r-- | Zend/zend_execute_API.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index f51289a94c..7ca181a179 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -622,6 +622,8 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS char *fname, *colon; int fname_len; + *fci->retval_ptr_ptr = NULL; + if (!EG(active)) { return FAILURE; /* executor is already inactive */ } @@ -652,11 +654,6 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS memset(&execute_data, 0, sizeof(zend_execute_data)); } - /* we may return SUCCESS, and yet retval may be uninitialized, - * if there was an exception... - */ - *fci->retval_ptr_ptr = NULL; - if (!fci_cache || !fci_cache->initialized) { if (Z_TYPE_P(fci->function_name)==IS_ARRAY) { /* assume array($obj, $name) couple */ zval **tmp_object_ptr, **tmp_real_function_name; |
