aboutsummaryrefslogtreecommitdiff
path: root/src/net.h
diff options
context:
space:
mode:
authorJohn Newbery <john@johnnewbery.com>2020-07-14 10:24:43 +0100
committerJohn Newbery <john@johnnewbery.com>2020-07-14 10:24:43 +0100
commitca3585a483ca5f6fc4cc54fd1530f89d13e5b7b0 (patch)
tree5c3a2b75bb283a132cbb8092ca01c929ab92800c /src/net.h
parent07c83ce0399a2811bdd764b0cce347ba3bdbe37c (diff)
[net/net processing] check banman pointer before dereferencing
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.
Diffstat (limited to 'src/net.h')
-rw-r--r--src/net.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/net.h b/src/net.h
index 6673e02d68..b240e52a18 100644
--- a/src/net.h
+++ b/src/net.h
@@ -447,6 +447,7 @@ private:
std::atomic<int> nBestHeight;
CClientUIInterface* clientInterface;
NetEventsInterface* m_msgproc;
+ /** Pointer to this node's banman. May be nullptr - check existence before dereferencing. */
BanMan* m_banman;
/** SipHasher seeds for deterministic randomness */