mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-18 05:12:45 +01:00
3a881d9b41
For sqlite3 versions < 3.14 (i.e. HAVE_SQLITE3_EXPANDED_SQL is not set), tracing is used to dump statements. The function db_sqlite3_exec() registers a tracing callback in the beginning and unregisters it at the end to "avoid it accessing the potentially stale pointer to stmt". However, the unregistering so far only happened in the success case, i.e. if the prepare or step calls failed, the callback was still set! Running the test wallet/test/db-run with sqlite 3.11 leads to a segmentation fault in the last call to db_commit_transaction(): the tested transaction contains an invalid statement and the (still registered) trace callback is triggered then by sqlite3_exec() in db_sqlite3_commit_tx(), leading to a segfault in db_changes_add() (according to gdb), where it tries to access "stmt->query->readonly". Changelog-None |
||
---|---|---|
.. | ||
test | ||
.gitignore | ||
db_common.h | ||
db_postgres.c | ||
db_sqlite3.c | ||
db.c | ||
db.h | ||
invoices.c | ||
invoices.h | ||
Makefile | ||
txfilter.c | ||
txfilter.h | ||
wallet.c | ||
wallet.h | ||
walletrpc.c | ||
walletrpc.h |