]> granicus.if.org Git - php/commitdiff
Fixed uninitialised data
authorDmitry Stogov <dmitry@php.net>
Fri, 25 Jul 2008 08:23:07 +0000 (08:23 +0000)
committerDmitry Stogov <dmitry@php.net>
Fri, 25 Jul 2008 08:23:07 +0000 (08:23 +0000)
Zend/zend_execute_API.c
ext/mysql/php_mysql.c
ext/mysqli/mysqli.c
ext/pdo/pdo_dbh.c
ext/pdo/pdo_stmt.c
ext/pgsql/pgsql.c
ext/reflection/php_reflection.c
ext/spl/spl_directory.c
ext/sqlite/sqlite.c
main/streams/userspace.c

index 0fb58515866938d3829c40d57c3de09b585c0e3f..8a676dcea0267eae101e51d9ff70540ecf7dd08c 100644 (file)
@@ -1254,6 +1254,7 @@ ZEND_API int zend_lookup_class_ex(const char *name, int name_length, int use_aut
        fcall_cache.initialized = EG(autoload_func) ? 1 : 0;
        fcall_cache.function_handler = EG(autoload_func);
        fcall_cache.calling_scope = NULL;
+       fcall_cache.called_scope = NULL;
        fcall_cache.object_pp = NULL;
 
        exception = EG(exception);
index 237bdb54e89c8da63158035fa0c3885120726012..b395f6cdc6b53d2193e6a090888500c60fe2ceeb 100644 (file)
@@ -2176,6 +2176,7 @@ static void php_mysql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int result_type,
                        fcc.initialized = 1;
                        fcc.function_handler = ce->constructor;
                        fcc.calling_scope = EG(scope);
+                       fcc.called_scope = Z_OBJCE_P(return_value);
                        fcc.object_pp = &return_value;
                
                        if (zend_call_function(&fci, &fcc TSRMLS_CC) == FAILURE) {
index 3056913d93e865df356c459784365ecfcc3b8edf..1cdab4dbd46f9d9aba4d925669851fb1a5b7a6ac 100644 (file)
@@ -1305,6 +1305,7 @@ void php_mysqli_fetch_into_hash(INTERNAL_FUNCTION_PARAMETERS, int override_flags
                        fcc.initialized = 1;
                        fcc.function_handler = ce->constructor;
                        fcc.calling_scope = EG(scope);
+                       fcc.called_scope = Z_OBJCE_P(return_value);
                        fcc.object_pp = &return_value;
 
                        if (zend_call_function(&fci, &fcc TSRMLS_CC) == FAILURE) {
index 5ed7c9845148a83668c6a5482ad8443cc3ee1921..48327beb37483f62b2a952a8a3f8089aee65b37a 100755 (executable)
@@ -477,6 +477,7 @@ static void pdo_stmt_construct(pdo_stmt_t *stmt, zval *object, zend_class_entry
                fcc.initialized = 1;
                fcc.function_handler = dbstmt_ce->constructor;
                fcc.calling_scope = EG(scope);
+               fcc.called_scope = Z_OBJCE_P(object);
                fcc.object_pp = &object;
 
                if (zend_call_function(&fci, &fcc TSRMLS_CC) == FAILURE) {
index 5b676798f5a90d4aaa30ba2967b52db072a2874e..f4ae51c2c4dc25a45b36d8441281a3bd2cf27a23 100755 (executable)
@@ -760,6 +760,7 @@ static int do_fetch_class_prepare(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
                fcc->initialized = 1;
                fcc->function_handler = ce->constructor;
                fcc->calling_scope = EG(scope);
+               fcc->called_scope = ce;
                return 1;
        } else if (stmt->fetch.cls.ctor_args) {
                pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "user-supplied class does not have a constructor, use NULL for the ctor_params parameter, or simply omit it" TSRMLS_CC);
@@ -859,6 +860,7 @@ static int make_callable_ex(pdo_stmt_t *stmt, zval *callable, zend_fcall_info *
        fcc->initialized = 1;
        fcc->function_handler = function_handler;
        fcc->calling_scope = EG(scope);
+       fcc->called_scope = Z_OBJCE_P(object);
        fcc->object_pp = object;
        
        return 1;
index 7f999391507f129f49f1f8267a20c0bd519fc331..16dc1b0d76f6e421d391edfdf27f4f7048c7276c 100644 (file)
@@ -2639,6 +2639,7 @@ static void php_pgsql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, long result_type,
                        fcc.initialized = 1;
                        fcc.function_handler = ce->constructor;
                        fcc.calling_scope = EG(scope);
+                       fcc.called_scope = Z_OBJCE_P(return_value);
                        fcc.object_pp = &return_value;
                
                        if (zend_call_function(&fci, &fcc TSRMLS_CC) == FAILURE) {
index c746d7e5bc43295ef8bc5209bc6adf16bb57b3d3..4a30b921b8c395a3b91f791ff4b0c3c01e4e31b9 100644 (file)
@@ -1235,6 +1235,7 @@ static void _reflection_export(INTERNAL_FUNCTION_PARAMETERS, zend_class_entry *c
        fcc.initialized = 1;
        fcc.function_handler = ce_ptr->constructor;
        fcc.calling_scope = ce_ptr;
+       fcc.called_scope = Z_OBJCE_P(reflection_ptr);
        fcc.object_pp = &reflector_ptr;
 
        result = zend_call_function(&fci, &fcc TSRMLS_CC);
@@ -1609,6 +1610,7 @@ ZEND_METHOD(reflection_function, invoke)
        fcc.initialized = 1;
        fcc.function_handler = fptr;
        fcc.calling_scope = EG(scope);
+       fcc.called_scope = NULL;
        fcc.object_pp = NULL;
 
        result = zend_call_function(&fci, &fcc TSRMLS_CC);
@@ -1673,6 +1675,7 @@ ZEND_METHOD(reflection_function, invokeArgs)
        fcc.initialized = 1;
        fcc.function_handler = fptr;
        fcc.calling_scope = EG(scope);
+       fcc.called_scope = NULL;
        fcc.object_pp = NULL;
 
        result = zend_call_function(&fci, &fcc TSRMLS_CC);
@@ -2413,6 +2416,7 @@ ZEND_METHOD(reflection_method, invoke)
        fcc.initialized = 1;
        fcc.function_handler = mptr;
        fcc.calling_scope = obj_ce;
+       fcc.called_scope = Z_OBJCE_PP(object_pp);
        fcc.object_pp = object_pp;
 
        result = zend_call_function(&fci, &fcc TSRMLS_CC);
@@ -2519,6 +2523,7 @@ ZEND_METHOD(reflection_method, invokeArgs)
        fcc.initialized = 1;
        fcc.function_handler = mptr;
        fcc.calling_scope = obj_ce;
+       fcc.called_scope = Z_OBJCE_P(object);
        fcc.object_pp = &object;
 
        result = zend_call_function(&fci, &fcc TSRMLS_CC);
@@ -3548,6 +3553,7 @@ ZEND_METHOD(reflection_class, newInstance)
                fcc.initialized = 1;
                fcc.function_handler = ce->constructor;
                fcc.calling_scope = EG(scope);
+               fcc.called_scope = Z_OBJCE_P(return_value);
                fcc.object_pp = &return_value;
 
                if (zend_call_function(&fci, &fcc TSRMLS_CC) == FAILURE) {
@@ -3627,6 +3633,7 @@ ZEND_METHOD(reflection_class, newInstanceArgs)
                fcc.initialized = 1;
                fcc.function_handler = ce->constructor;
                fcc.calling_scope = EG(scope);
+               fcc.called_scope = Z_OBJCE_P(return_value);
                fcc.object_pp = &return_value;
 
                if (zend_call_function(&fci, &fcc TSRMLS_CC) == FAILURE) {
index 66f6ae5dc37c8e1870a989450c27ee9f881212c8..752a3e545146b70fccaf3ce629024669242c86f1 100755 (executable)
@@ -1812,6 +1812,7 @@ static int spl_filesystem_file_call(spl_filesystem_object *intern, zend_function
        fcic.initialized = 1;
        fcic.function_handler = func_ptr;
        fcic.calling_scope = NULL;
+       fcic.called_scope = NULL;
        fcic.object_pp = NULL;
 
        result = zend_call_function(&fci, &fcic TSRMLS_CC);
index b643c23be9a8f177f46dcb1eb8f3ccf23733aa89..b1d36fdba2325335673ba19b0776aeaa46e6ed96 100644 (file)
@@ -2507,6 +2507,7 @@ PHP_FUNCTION(sqlite_fetch_object)
                fcc.initialized = 1;
                fcc.function_handler = ce->constructor;
                fcc.calling_scope = EG(scope);
+               fcc.called_scope = Z_OBJCE_P(return_value);
                fcc.object_pp = &return_value;
 
                if (zend_call_function(&fci, &fcc TSRMLS_CC) == FAILURE) {
index 452c2aab0f6df6be6a8a32bc9fa05fc06483ab04..fbd03f1d562355bb7239c67b6a367abf213d9866 100644 (file)
@@ -262,6 +262,7 @@ static php_stream *user_wrapper_opener(php_stream_wrapper *wrapper, char *filena
                fcc.initialized = 1;
                fcc.function_handler = uwrap->ce->constructor;
                fcc.calling_scope = EG(scope);
+               fcc.called_scope = Z_OBJCE_P(us->object);
                fcc.object_pp = &us->object;
 
                if (zend_call_function(&fci, &fcc TSRMLS_CC) == FAILURE) {