mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Merge branch 'PHP-5.4' into PHP-5.5
Conflicts: configure.in ext/mysqlnd/mysqlnd.c main/php_version.h
This commit is contained in:
commit
d4f5ca467f
3 changed files with 35 additions and 3 deletions
|
@ -2247,7 +2247,6 @@ MYSQLND_METHOD(mysqlnd_conn_data, change_user)(MYSQLND_CONN_DATA * const conn,
|
|||
}
|
||||
if (!db) {
|
||||
db = "";
|
||||
|
||||
}
|
||||
|
||||
/* XXX: passwords that have \0 inside work during auth, but in this case won't work with change user */
|
||||
|
|
|
@ -460,7 +460,7 @@ static void pdo_stmt_construct(pdo_stmt_t *stmt, zval *object, zend_class_entry
|
|||
if (dbstmt_ce->constructor) {
|
||||
zend_fcall_info fci;
|
||||
zend_fcall_info_cache fcc;
|
||||
zval *retval;
|
||||
zval *retval = NULL;
|
||||
|
||||
fci.size = sizeof(zend_fcall_info);
|
||||
fci.function_table = &dbstmt_ce->function_table;
|
||||
|
@ -495,7 +495,7 @@ static void pdo_stmt_construct(pdo_stmt_t *stmt, zval *object, zend_class_entry
|
|||
zval_dtor(object);
|
||||
ZVAL_NULL(object);
|
||||
object = NULL; /* marks failure */
|
||||
} else {
|
||||
} else if (retval) {
|
||||
zval_ptr_dtor(&retval);
|
||||
}
|
||||
|
||||
|
|
33
ext/pdo_sqlite/tests/bug66033.phpt
Normal file
33
ext/pdo_sqlite/tests/bug66033.phpt
Normal file
|
@ -0,0 +1,33 @@
|
|||
--TEST--
|
||||
Bug #66033 (Segmentation Fault when constructor of PDO statement throws an exception)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('pdo_sqlite')) print 'skip not loaded';
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
class DBStatement extends PDOStatement {
|
||||
public $dbh;
|
||||
protected function __construct($dbh) {
|
||||
$this->dbh = $dbh;
|
||||
throw new Exception("Blah");
|
||||
}
|
||||
}
|
||||
|
||||
$pdo = new PDO('sqlite::memory:', null, null);
|
||||
$pdo->setAttribute(PDO::ATTR_STATEMENT_CLASS, array('DBStatement',
|
||||
array($pdo)));
|
||||
$pdo->exec("CREATE TABLE IF NOT EXISTS messages (
|
||||
id INTEGER PRIMARY KEY,
|
||||
title TEXT,
|
||||
message TEXT,
|
||||
time INTEGER)");
|
||||
|
||||
try {
|
||||
$pdoStatement = $pdo->query("select * from messages");
|
||||
} catch (Exception $e) {
|
||||
var_dump($e->getMessage());
|
||||
}
|
||||
?>
|
||||
--EXPECTF--
|
||||
string(4) "Blah"
|
Loading…
Add table
Add a link
Reference in a new issue