p2p: fix array out of bounds issue (#23165)

revert-23120-drop-eth-65
Evolution404 4 years ago committed by GitHub
parent bd566977e8
commit 5afc82de6e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      p2p/peer_error.go

@ -89,7 +89,7 @@ var discReasonToString = [...]string{
}
func (d DiscReason) String() string {
if len(discReasonToString) < int(d) {
if len(discReasonToString) <= int(d) {
return fmt.Sprintf("unknown disconnect reason %d", d)
}
return discReasonToString[d]

Loading…
Cancel
Save