HomePhabricator

[backport#16796] wallet: Fix segfault in CreateWalletFromFile

Description

[backport#16796] wallet: Fix segfault in CreateWalletFromFile

Summary:
wallet: Fix segmentation fault in CreateWalletFromFile (MarcoFalke)
test: Print both messages on failure in assert_raises_message (MarcoFalke)
wallet: Fix documentation around WalletParameterInteraction (MarcoFalke)

Pull request description:

Comes with a test to aid review. The test should fail without the fix to bitcoind

The following `CreateWalletFromFile` issues are fixed:

* `walletFile` refers to freed memory and will thus corrupt the debug.log and/or crash the node if read
* `WalletParameterInteraction` was moved to `CreateWalletFromFile` and `WalletInit::ParameterInteraction` without updating the documentation

https://github.com/bitcoin/bitcoin/pull/16796/files


Backport of Core PR16796

Test Plan:

ninja check check-functional

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D7053

Details

Provenance
Samuel Dobson <dobsonsa68@gmail.com>Authored on Sep 9 2019, 11:33
majcostaCommitted on Jul 28 2020, 08:25
majcostaPushed on Jul 28 2020, 08:25
Reviewer
Restricted Project
Differential Revision
D7053: [backport#16796] wallet: Fix segfault in CreateWalletFromFile
Parents
rABC35f36b8ef112: [backport#16620] util: Move ResolveErrMsg to util/error
Branches
Unknown
Tags
Unknown