Skip to content

Commit

Permalink
fix(share/peer-manager): fix potential nil dereference in peer manager (
Browse files Browse the repository at this point in the history
  • Loading branch information
walldiss authored Feb 13, 2025
1 parent 70d6351 commit 75dca6f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion share/shwap/p2p/shrex/peers/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,12 @@ func (m *Manager) doneFunc(datahash share.DataHash, peerID peer.ID, source peerS
m.nodes.putOnCooldown(peerID)
return
}
m.getPool(datahash.String()).putOnCooldown(peerID)
p := m.getPool(datahash.String())
if p == nil {
// pool was removed
return
}
p.putOnCooldown(peerID)
case ResultBlacklistPeer:
m.blacklistPeers(reasonMisbehave, peerID)
}
Expand Down

0 comments on commit 75dca6f

Please sign in to comment.