mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 02:12:23 +00:00
p2p/discv5: fix idx can be negative after uint convert to int(can cause crash)
This commit is contained in:
parent
93c0f1715d
commit
2dc0ae743b
1 changed files with 1 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue