HomePhabricator

[net/net processing] check banman pointer before dereferencing

Description

[net/net processing] check banman pointer before dereferencing

Summary:

Although we currently don't do this, it should be possible to create a
CConnman or PeerLogicValidation without a Banman instance. Therefore
always check that banman exists before dereferencing the pointer.

Also add comments to the m_banman members of CConnman and
PeerLogicValidation to document that these may be nullptr.

Backport of core PR19514.

Depends on D8794.

Test Plan:

ninja all check-all

Reviewers: #bitcoin_abc, PiRK

Reviewed By: #bitcoin_abc, PiRK

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

Details

Provenance
John Newbery <john@johnnewbery.com>Authored on Jul 14 2020, 09:24
FabienCommitted on Jan 6 2021, 12:46
FabienPushed on Jan 6 2021, 12:47
Reviewer
Restricted Project
Differential Revision
D8795: [net/net processing] check banman pointer before dereferencing
Parents
rABCb6a215da6d3c: [p2p] Add Peer struct for per-peer data in net processing
Branches
Unknown
Tags
Unknown