[#607] network: Prevent potential panic in Address.Equal
method
Make `Address.Equal` method to accept value instead of pointer in order to prevent NPE. Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
6de0af0650
commit
fdd123ad98
3 changed files with 4 additions and 4 deletions
|
@ -503,7 +503,7 @@ func (c *reputationClientConstructor) Get(addr *network.Address) (client.Client,
|
|||
for i := range nm.Nodes {
|
||||
netAddr, err := network.AddressFromString(nm.Nodes[i].Address())
|
||||
if err == nil {
|
||||
if netAddr.Equal(addr) {
|
||||
if netAddr.Equal(*addr) {
|
||||
prm := truststorage.UpdatePrm{}
|
||||
prm.SetPeer(reputation.PeerIDFromBytes(nm.Nodes[i].PublicKey()))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue