mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-05-23 12:24:42 +02:00
Change CChain::Contains() to take reference
The `CChain::Contains()` method dereferences its input without checking, potentially resulting in nullptr-dereference if invoked with `nullptr`. To avoid this possibility, its input is changed to a reference instead. Call sites are adapted accoringly, extra nullptr-check is added as needed.
This commit is contained in:
@@ -45,7 +45,7 @@ bool TestLockPointValidity(CChain& active_chain, const LockPoints& lp)
|
||||
if (lp.maxInputBlock) {
|
||||
// Check whether active_chain is an extension of the block at which the LockPoints
|
||||
// calculation was valid. If not LockPoints are no longer valid
|
||||
if (!active_chain.Contains(lp.maxInputBlock)) {
|
||||
if (!active_chain.Contains(*lp.maxInputBlock)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user