diff options
author | Felipe Pena <felipe@php.net> | 2010-06-16 23:13:29 +0000 |
---|---|---|
committer | Felipe Pena <felipe@php.net> | 2010-06-16 23:13:29 +0000 |
commit | d596ea742a1b08f0eab8c5d0bd2a06b73039002c (patch) | |
tree | a3767b1817d0724233b211a8cb4ae1969909ad15 | |
parent | d47e50a9ff6fc77215c36618cf4ba182c1e4e9b9 (diff) | |
download | php-git-d596ea742a1b08f0eab8c5d0bd2a06b73039002c.tar.gz |
- Fix crash when calling a method of a class that inherits PDOStatement if instantiated directly
-rwxr-xr-x | ext/pdo/pdo_stmt.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/ext/pdo/pdo_stmt.c b/ext/pdo/pdo_stmt.c index 5ac2c7ac2d..7f8203c1d8 100755 --- a/ext/pdo/pdo_stmt.c +++ b/ext/pdo/pdo_stmt.c @@ -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]) { |