diff options
author | MeshCollider <dobsonsa68@gmail.com> | 2017-08-23 19:47:56 +1200 |
---|---|---|
committer | MeshCollider <dobsonsa68@gmail.com> | 2017-08-23 19:47:56 +1200 |
commit | c0019924406e1ce8368465c768de11019ad5eeed (patch) | |
tree | 3942cecb72ede011b95aa2bba57ab76e10da520c /src/net_processing.cpp | |
parent | 3e55f13bfc98a6b832697d1d0cfb942dbe2094db (diff) |
Fix potential null dereferences
Diffstat (limited to 'src/net_processing.cpp')
-rw-r--r-- | src/net_processing.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/net_processing.cpp b/src/net_processing.cpp index 596ae1139b..9a446a9308 100644 --- a/src/net_processing.cpp +++ b/src/net_processing.cpp @@ -281,6 +281,7 @@ void FinalizeNode(NodeId nodeid, bool& fUpdateConnectionTime) { fUpdateConnectionTime = false; LOCK(cs_main); CNodeState *state = State(nodeid); + assert(state != nullptr); if (state->fSyncStarted) nSyncStarted--; @@ -315,6 +316,7 @@ bool MarkBlockAsReceived(const uint256& hash) { std::map<uint256, std::pair<NodeId, std::list<QueuedBlock>::iterator> >::iterator itInFlight = mapBlocksInFlight.find(hash); if (itInFlight != mapBlocksInFlight.end()) { CNodeState *state = State(itInFlight->second.first); + assert(state != nullptr); state->nBlocksInFlightValidHeaders -= itInFlight->second.second->fValidatedHeaders; if (state->nBlocksInFlightValidHeaders == 0 && itInFlight->second.second->fValidatedHeaders) { // Last validated block on the queue was received. |