Skip to content

Commit

Permalink
p2p: fix array out of bounds issue (#23165)
Browse files Browse the repository at this point in the history
  • Loading branch information
Evolution404 authored Jul 6, 2021
1 parent bd56697 commit 5afc82d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion p2p/peer_error.go
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit 5afc82d

Please sign in to comment.