HomePhabricator

Fix heap-use-after-free in activation_tests

Description

Fix heap-use-after-free in activation_tests

Summary: CreateChainParams() returns a unique_ptr that ends up with no owner. This patch fixes that.

Test Plan:

cmake -GNinja -DCMAKE_BUILD_TYPE=Debug -DENABLE_SANITIZERS=address -DCCACHE=OFF ..
ninja test_bitcoin
./src/test/test_bitcoin --run_test=activation_tests

Before patch: Same failure as seen here: https://build.bitcoinabc.org/viewLog.html?buildId=24568&buildTypeId=BitcoinABC_Master_BitcoinAbcMasterAsan&tab=buildLog&_focus=1047
After patch: No errors detected

Reviewers: #bitcoin_abc, deadalnix, Fabien

Reviewed By: #bitcoin_abc, deadalnix, Fabien

Subscribers: Fabien

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

Details

Provenance
jasonbcoxAuthored on Dec 21 2019, 01:56
jasonbcoxPushed on Dec 22 2019, 17:47
Reviewer
Restricted Project
Differential Revision
D4795: Fix heap-use-after-free in activation_tests
Parents
rSTAGINGbd8bd952b4cc: Remove GetPriority from CCoinsViewCache
Branches
Unknown
Tags
Unknown