Skip to content

Commit

Permalink
Merge #9549: [net] Avoid possibility of NULL pointer dereference in M…
Browse files Browse the repository at this point in the history
…arkBlockAsInFlight(...)

95543d8 [net] Avoid possibility of NULL pointer dereference in MarkBlockAsInFlight(...) (practicalswift)

Tree-SHA512: 80fd4f2712f20377185bd8d319255f2c54ae47b54c706f7e0d384a0a6ade1465ceb6e2a4a7f7b51987a659524474a954eddf228865ebb3fc513948b5b6d7ab6d
  • Loading branch information
sipa committed Jun 21, 2017
2 parents d636f39 + 95543d8 commit b33ca14
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/net_processing.cpp
Expand Up @@ -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;
}

Expand Down

0 comments on commit b33ca14

Please sign in to comment.