mirror of
https://github.com/php/php-src.git
synced 2025-08-18 15:08:55 +02:00
- Fix crash when calling a method of a class that inherits PDOStatement if instantiated directly
This commit is contained in:
parent
d47e50a9ff
commit
d596ea742a
1 changed files with 4 additions and 0 deletions
|
@ -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]) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue