Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed bug #69972 (Use-after-free vulnerability in sqlite3SafetyCheckS…
…ickOrOk())
- Loading branch information
Showing
3 changed files
with
42 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
--TEST-- | ||
Bug #69972 (Use-after-free vulnerability in sqlite3SafetyCheckSickOrOk()) | ||
--SKIPIF-- | ||
<?php | ||
if (!extension_loaded('sqlite3')) die('skip'); | ||
?> | ||
--FILE-- | ||
<?php | ||
$db = new SQLite3(':memory:'); | ||
echo "SELECTING from invalid table\n"; | ||
$result = $db->query("SELECT * FROM non_existent_table"); | ||
echo "Closing database\n"; | ||
var_dump($db->close()); | ||
echo "Done\n"; | ||
|
||
// Trigger the use-after-free | ||
echo "Error Code: " . $db->lastErrorCode() . "\n"; | ||
echo "Error Msg: " . $db->lastErrorMsg() . "\n"; | ||
?> | ||
--EXPECTF-- | ||
SELECTING from invalid table | ||
|
||
Warning: SQLite3::query(): Unable to prepare statement: 1, no such table: non_existent_table in %sbug69972.php on line %d | ||
Closing database | ||
bool(true) | ||
Done | ||
Error Code: 0 | ||
Error Msg: |