aboutsummaryrefslogtreecommitdiffstats
path: root/p2p
diff options
context:
space:
mode:
authorlibotony <liboliqi@gmail.com>2018-08-09 15:03:42 +0800
committerPéter Szilágyi <peterke@gmail.com>2018-08-09 15:03:42 +0800
commit834057592f68eecc45382794c0fed96e594e14d1 (patch)
tree3e2fab141a47d78ad2228afc73bdcefaec067371 /p2p
parentabbb219933504a2aa739353a1cb6157cdd0cf145 (diff)
downloaddexon-834057592f68eecc45382794c0fed96e594e14d1.tar
dexon-834057592f68eecc45382794c0fed96e594e14d1.tar.gz
dexon-834057592f68eecc45382794c0fed96e594e14d1.tar.bz2
dexon-834057592f68eecc45382794c0fed96e594e14d1.tar.lz
dexon-834057592f68eecc45382794c0fed96e594e14d1.tar.xz
dexon-834057592f68eecc45382794c0fed96e594e14d1.tar.zst
dexon-834057592f68eecc45382794c0fed96e594e14d1.zip
p2p/discv5: fix negative index after uint convert to int (#17274)
Diffstat (limited to 'p2p')
-rw-r--r--p2p/discv5/net.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/p2p/discv5/net.go b/p2p/discv5/net.go
index 9b0bd0c80..4c39c0553 100644
--- a/p2p/discv5/net.go
+++ b/p2p/discv5/net.go
@@ -1228,7 +1228,7 @@ func (net *Network) checkTopicRegister(data *topicRegister) (*pong, error) {
if rlpHash(data.Topics) != pongpkt.data.(*pong).TopicHash {
return nil, errors.New("topic hash mismatch")
}
- if data.Idx < 0 || int(data.Idx) >= len(data.Topics) {
+ if int(data.Idx) < 0 || int(data.Idx) >= len(data.Topics) {
return nil, errors.New("topic index out of range")
}
return pongpkt.data.(*pong), nil