mirror of
https://github.com/php/php-src.git
synced 2026-03-24 08:12:21 +01:00
For rationale, see #6787 Extensions migrated in part 4: * simplexml * skeleton * soap * spl * sqlite3 * sysvmsg * sysvsem * tidy - also removed a check for an ancient dependency version
24 lines
584 B
PHP
24 lines
584 B
PHP
--TEST--
|
|
Bug #66550 (SQLite prepared statement use-after-free)
|
|
--EXTENSIONS--
|
|
sqlite3
|
|
--FILE--
|
|
<?php
|
|
|
|
$db = new SQLite3(':memory:');
|
|
|
|
$db->exec('CREATE TABLE foo (id INTEGER, bar STRING)');
|
|
|
|
$stmt = $db->prepare('SELECT bar FROM foo WHERE id=:id');
|
|
// Close the database connection and free the internal sqlite3_stmt object
|
|
$db->close();
|
|
// Access the sqlite3_stmt object via the php_sqlite3_stmt container
|
|
try {
|
|
$stmt->reset();
|
|
} catch (\Error $e) {
|
|
echo $e->getMessage() . \PHP_EOL;
|
|
}
|
|
?>
|
|
--EXPECT--
|
|
The SQLite3 object has not been correctly initialised or is already closed
|