]> granicus.if.org Git - php/commitdiff
- Fix crash when calling a method of a class that inherits PDOStatement if instantiat...
authorFelipe Pena <felipe@php.net>
Wed, 16 Jun 2010 23:13:29 +0000 (23:13 +0000)
committerFelipe Pena <felipe@php.net>
Wed, 16 Jun 2010 23:13:29 +0000 (23:13 +0000)
ext/pdo/pdo_stmt.c

index 5ac2c7ac2d537f5c9315a0c5c03c9700f9fa1640..7f8203c1d8d20c5420ccc4f844e6878894cce0ea 100755 (executable)
@@ -2282,6 +2282,10 @@ static union _zend_function *dbstmt_method_get(
        if (zend_hash_find(&Z_OBJCE_P(object)->function_table, lc_method_name, 
                        method_len+1, (void**)&fbc) == FAILURE) {
                pdo_stmt_t *stmt = (pdo_stmt_t*)zend_object_store_get_object(object TSRMLS_CC);
+               /* instance not created by PDO object */
+               if (!stmt->dbh) {
+                       goto out;
+               }
                /* not a pre-defined method, nor a user-defined method; check
                 * the driver specific methods */
                if (!stmt->dbh->cls_methods[PDO_DBH_DRIVER_METHOD_KIND_STMT]) {