diff options
author | Pieter Wuille <pieter.wuille@gmail.com> | 2017-06-20 16:19:34 -0700 |
---|---|---|
committer | Pieter Wuille <pieter.wuille@gmail.com> | 2017-06-20 17:02:40 -0700 |
commit | b33ca14f594e2cf2a16ef27778169deb7cc9f4dc (patch) | |
tree | a0750f8d312eca39800c99cd83b1ca1ee58cae01 | |
parent | d636f3943d39ec893dab2d2546f77f3f2607769d (diff) | |
parent | 95543d8747cbf7c1945ac36c36031ae40152cf2f (diff) | |
download | bitcoin-b33ca14f594e2cf2a16ef27778169deb7cc9f4dc.tar.xz |
Merge #9549: [net] Avoid possibility of NULL pointer dereference in MarkBlockAsInFlight(...)
95543d874 [net] Avoid possibility of NULL pointer dereference in MarkBlockAsInFlight(...) (practicalswift)
Tree-SHA512: 80fd4f2712f20377185bd8d319255f2c54ae47b54c706f7e0d384a0a6ade1465ceb6e2a4a7f7b51987a659524474a954eddf228865ebb3fc513948b5b6d7ab6d
-rw-r--r-- | src/net_processing.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/net_processing.cpp b/src/net_processing.cpp index b9357440e9..91681265b1 100644 --- a/src/net_processing.cpp +++ b/src/net_processing.cpp @@ -342,7 +342,9 @@ bool MarkBlockAsInFlight(NodeId nodeid, const uint256& hash, const CBlockIndex* // Short-circuit most stuff in case its from the same node std::map<uint256, std::pair<NodeId, std::list<QueuedBlock>::iterator> >::iterator itInFlight = mapBlocksInFlight.find(hash); if (itInFlight != mapBlocksInFlight.end() && itInFlight->second.first == nodeid) { - *pit = &itInFlight->second.second; + if (pit) { + *pit = &itInFlight->second.second; + } return false; } |