core-lightning/wallet
Sebastian Falbesoner 3a881d9b41 db: unregister sqlite3 trace callback also in error case
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
2020-05-07 10:41:16 +09:30
..
test plugin_hook_call: return indication whether we called the callback or not. 2020-05-05 13:45:17 +09:30
.gitignore wallet: Create and manage a sqlite3 database for the wallet 2017-06-06 09:16:10 +09:30
db_common.h db: Track the data_version in the database 2020-01-02 14:12:59 -06:00
db_postgres.c db: Implement postgres driver primitives 2019-09-22 02:03:43 +00:00
db_sqlite3.c db: unregister sqlite3 trace callback also in error case 2020-05-07 10:41:16 +09:30
db.c wallet-df: save our_funds amount to channel record 2020-05-07 08:43:00 +09:30
db.h common: add struct onionreply 2020-01-23 16:17:42 +10:30
invoices.c wallet: add invoice features into db. 2019-11-24 23:33:17 +00:00
invoices.h wallet: add invoice features into db. 2019-11-24 23:33:17 +00:00
Makefile wallet/Makefile: fix dependency line. 2019-11-28 11:50:13 +01:00
txfilter.c common: tal_dup_talarr() helper. 2020-02-27 14:16:16 +10:30
txfilter.h pubkey: rename PUBKEY_DER_LEN to PUBKEY_CMPR_LEN. 2019-04-09 12:37:16 -07:00
wallet.c utxo: add scriptSig + scriptPubkey field 2020-05-07 08:43:00 +09:30
wallet.h utxo: add scriptSig + scriptPubkey field 2020-05-07 08:43:00 +09:30
walletrpc.c chaintopology: better feerate targets differentiation 2020-03-30 20:17:18 +10:30
walletrpc.h Use expected LIGHTNING_DIR_FILE_H define 2018-03-25 23:54:21 +00:00