mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3: Fix GH-17837: ::getColumnMeta() on unexecuted statement segfaults
This commit is contained in:
4
NEWS
4
NEWS
@@ -54,6 +54,10 @@ PHP NEWS
|
||||
. Fixed bug GH-17747 (Exception on reading property in register-based
|
||||
FETCH_OBJ_R breaks JIT). (Dmitry, nielsdos)
|
||||
|
||||
- PDO_SQLite:
|
||||
. Fixed GH-17837 ()::getColumnMeta() on unexecuted statement segfaults).
|
||||
(cmb)
|
||||
|
||||
- Phar:
|
||||
. Fixed bug GH-17808: PharFileInfo refcount bug. (nielsdos)
|
||||
|
||||
|
||||
@@ -305,7 +305,7 @@ static int pdo_sqlite_stmt_col_meta(pdo_stmt_t *stmt, zend_long colno, zval *ret
|
||||
const char *str;
|
||||
zval flags;
|
||||
|
||||
if (!S->stmt) {
|
||||
if (!S->stmt || !stmt->executed) {
|
||||
return FAILURE;
|
||||
}
|
||||
if(colno >= sqlite3_column_count(S->stmt)) {
|
||||
|
||||
14
ext/pdo_sqlite/tests/gh17837.phpt
Normal file
14
ext/pdo_sqlite/tests/gh17837.phpt
Normal file
@@ -0,0 +1,14 @@
|
||||
--TEST--
|
||||
GH-17837 (::getColumnMeta() on unexecuted statement segfaults)
|
||||
--EXTENSIONS--
|
||||
pdo_sqlite
|
||||
--CREDITS--
|
||||
YuanchengJiang
|
||||
--FILE--
|
||||
<?php
|
||||
$db = new PDO('sqlite::memory:');
|
||||
$stmt = $db->prepare('select :a, :b, ?');
|
||||
var_dump($stmt->getColumnMeta(0));
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(false)
|
||||
Reference in New Issue
Block a user