Skip to content
This repository has been archived by the owner on Mar 21, 2024. It is now read-only.

Commit

Permalink
Merge pull request #1313 from Bytom/fix_prod
Browse files Browse the repository at this point in the history
p2p/discv5: fix idx can be negative after uint convert to int(can cau…
  • Loading branch information
Paladz authored Sep 3, 2018
2 parents 2bc2396 + a79fbcb commit 6568627
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion p2p/discover/net.go
Original file line number Diff line number Diff line change
Expand Up @@ -1221,7 +1221,7 @@ func (net *Network) checkTopicRegister(data *topicRegister) (*pong, error) {
if hash != 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
Expand Down

0 comments on commit 6568627

Please sign in to comment.