[php-src] Issue #23728: sqlite segv
| From: | djarfluka | Date: | Thu, 17 Sep 2026 16:04:48 +0000 |
| Subject: | [php-src] Issue #23728: sqlite segv | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-252763@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/23728
Author: djarfluka
### Description
The following code:
```php
<?php
$db = new SQLite3(':memory:');
$db->createFunction('evil', function () {
global $stmt;
$stmt->close();
return 1;
});
$stmt = $db->prepare("SELECT evil()");
$res = $stmt->execute();
```
Resulted in this output (truncated):
```
==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000063 ... READ
#0 sqlite3ApiExit (libsqlite3.so.0+0x912b4)
#1 sqlite3_step (libsqlite3.so.0+0xe1fb0)
#2 zim_SQLite3Stmt_execute ext/sqlite3/sqlite3.c:1901:16
```
### PHP Version
```plain
8.6.0-dev
```
### Operating System
Ubuntu 22.04