bug69972.phpt 671 B

1234567891011121314151617181920212223242526
  1. --TEST--
  2. Bug #69972 (Use-after-free vulnerability in sqlite3SafetyCheckSickOrOk())
  3. --EXTENSIONS--
  4. sqlite3
  5. --FILE--
  6. <?php
  7. $db = new SQLite3(':memory:');
  8. echo "SELECTING from invalid table\n";
  9. $result = $db->query("SELECT * FROM non_existent_table");
  10. echo "Closing database\n";
  11. var_dump($db->close());
  12. echo "Done\n";
  13. // Trigger the use-after-free
  14. echo "Error Code: " . $db->lastErrorCode() . "\n";
  15. echo "Error Msg: " . $db->lastErrorMsg() . "\n";
  16. ?>
  17. --EXPECTF--
  18. SELECTING from invalid table
  19. Warning: SQLite3::query(): Unable to prepare statement: 1, no such table: non_existent_table in %sbug69972.php on line %d
  20. Closing database
  21. bool(true)
  22. Done
  23. Error Code: 0
  24. Error Msg: