diff options
author | HAOYUatHZ <37070449+HAOYUatHZ@users.noreply.github.com> | 2018-09-03 22:47:20 +0800 |
---|---|---|
committer | Felix Lange <fjl@users.noreply.github.com> | 2018-09-03 22:47:20 +0800 |
commit | 5c0954afffe223ea61ea42dbc74ec7dbdc3663a1 (patch) | |
tree | e54c0be3b1c2b9e697e69b5ca2b12a1d57df5331 | |
parent | 62e94895da80838ec694b4ba19eeac80c9dc88c1 (diff) | |
download | go-tangerine-5c0954afffe223ea61ea42dbc74ec7dbdc3663a1.tar go-tangerine-5c0954afffe223ea61ea42dbc74ec7dbdc3663a1.tar.gz go-tangerine-5c0954afffe223ea61ea42dbc74ec7dbdc3663a1.tar.bz2 go-tangerine-5c0954afffe223ea61ea42dbc74ec7dbdc3663a1.tar.lz go-tangerine-5c0954afffe223ea61ea42dbc74ec7dbdc3663a1.tar.xz go-tangerine-5c0954afffe223ea61ea42dbc74ec7dbdc3663a1.tar.zst go-tangerine-5c0954afffe223ea61ea42dbc74ec7dbdc3663a1.zip |
p2p/discv5: make idx bounds checking more sound (#17571)
-rw-r--r-- | p2p/discv5/net.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/p2p/discv5/net.go b/p2p/discv5/net.go index b93c93d64..a6cabf080 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 int(data.Idx) < 0 || int(data.Idx) >= len(data.Topics) { + if data.Idx >= uint(len(data.Topics)) { return nil, errors.New("topic index out of range") } return pongpkt.data.(*pong), nil |