mirror of
https://github.com/php/php-src.git
synced 2024-09-21 18:07:23 +00:00
Merge branch 'PHP-7.4' into master
* PHP-7.4: Fix #67465: NULL Pointer dereference in odbc_handle_preparer
This commit is contained in:
commit
99b3631e9a
@ -177,6 +177,8 @@ static int odbc_handle_preparer(pdo_dbh_t *dbh, const char *sql, size_t sql_len,
|
||||
return 0;
|
||||
}
|
||||
|
||||
stmt->driver_data = S;
|
||||
|
||||
cursor_type = pdo_attr_lval(driver_options, PDO_ATTR_CURSOR, PDO_CURSOR_FWDONLY);
|
||||
if (cursor_type != PDO_CURSOR_FWDONLY) {
|
||||
rc = SQLSetStmtAttr(S->stmt, SQL_ATTR_CURSOR_SCROLLABLE, (void*)SQL_SCROLLABLE, 0);
|
||||
@ -195,7 +197,6 @@ static int odbc_handle_preparer(pdo_dbh_t *dbh, const char *sql, size_t sql_len,
|
||||
efree(nsql);
|
||||
}
|
||||
|
||||
stmt->driver_data = S;
|
||||
stmt->methods = &odbc_stmt_methods;
|
||||
|
||||
if (rc != SQL_SUCCESS) {
|
||||
|
17
ext/pdo_odbc/tests/bug67465.phpt
Normal file
17
ext/pdo_odbc/tests/bug67465.phpt
Normal file
@ -0,0 +1,17 @@
|
||||
--TEST--
|
||||
Bug #67465 (NULL Pointer dereference in odbc_handle_preparer)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('pdo_odbc')) die('skip pdo_odbc extension not available');
|
||||
require 'ext/pdo/tests/pdo_test.inc';
|
||||
PDOTest::skip();
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require 'ext/pdo/tests/pdo_test.inc';
|
||||
$db = PDOTest::test_factory(dirname(__FILE__) . '/common.phpt');
|
||||
$db->prepare("SELECT 1", [PDO::ATTR_CURSOR => PDO::CURSOR_SCROLL]);
|
||||
echo "done\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
done
|
Loading…
Reference in New Issue
Block a user