Skip to content

Commit 18d287e

Browse files
committed
ext/sqlite3: fix wrong pointer types passed to the free list comparator.
SQLite3Stmt::close() and SQLite3Result::finalize() passed php_sqlite3_stmt pointer types instead of sqlite3_stmt pointers to zend_llist_del_element, causing the comparator to never match and both methods to silently become no-ops. Regression introduced in 5eae6d1 ("Don't store the object zval directly").
1 parent 6932260 commit 18d287e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ext/sqlite3/sqlite3.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1415,7 +1415,7 @@ PHP_METHOD(SQLite3Stmt, close)
14151415

14161416
SQLITE3_CHECK_INITIALIZED(stmt_obj->db_obj, stmt_obj->initialised, SQLite3);
14171417

1418-
zend_llist_del_element(&(stmt_obj->db_obj->free_list), stmt_obj, (int (*)(void *, void *)) php_sqlite3_compare_stmt_free);
1418+
zend_llist_del_element(&(stmt_obj->db_obj->free_list), stmt_obj->stmt, (int (*)(void *, void *)) php_sqlite3_compare_stmt_free);
14191419

14201420
RETURN_TRUE;
14211421
}
@@ -2145,7 +2145,7 @@ PHP_METHOD(SQLite3Result, finalize)
21452145

21462146
/* We need to finalize an internal statement */
21472147
if (!result_obj->is_prepared_statement) {
2148-
zend_llist_del_element(&(result_obj->db_obj->free_list), &result_obj->stmt_obj,
2148+
zend_llist_del_element(&(result_obj->db_obj->free_list), result_obj->stmt_obj->stmt,
21492149
(int (*)(void *, void *)) php_sqlite3_compare_stmt_free);
21502150
} else {
21512151
sqlite3_reset(result_obj->stmt_obj->stmt);

0 commit comments

Comments
 (0)