Skip to content

Commit b33ca14

Browse files
committed
Merge #9549: [net] Avoid possibility of NULL pointer dereference in MarkBlockAsInFlight(...)
95543d8 [net] Avoid possibility of NULL pointer dereference in MarkBlockAsInFlight(...) (practicalswift) Tree-SHA512: 80fd4f2712f20377185bd8d319255f2c54ae47b54c706f7e0d384a0a6ade1465ceb6e2a4a7f7b51987a659524474a954eddf228865ebb3fc513948b5b6d7ab6d
2 parents d636f39 + 95543d8 commit b33ca14

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/net_processing.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,9 @@ bool MarkBlockAsInFlight(NodeId nodeid, const uint256& hash, const CBlockIndex*
342342
// Short-circuit most stuff in case its from the same node
343343
std::map<uint256, std::pair<NodeId, std::list<QueuedBlock>::iterator> >::iterator itInFlight = mapBlocksInFlight.find(hash);
344344
if (itInFlight != mapBlocksInFlight.end() && itInFlight->second.first == nodeid) {
345-
*pit = &itInFlight->second.second;
345+
if (pit) {
346+
*pit = &itInFlight->second.second;
347+
}
346348
return false;
347349
}
348350

0 commit comments

Comments
 (0)