Skip to content

Commit 5afc82d

Browse files
authored
p2p: fix array out of bounds issue (#23165)
1 parent bd56697 commit 5afc82d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

p2p/peer_error.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ var discReasonToString = [...]string{
8989
}
9090

9191
func (d DiscReason) String() string {
92-
if len(discReasonToString) < int(d) {
92+
if len(discReasonToString) <= int(d) {
9393
return fmt.Sprintf("unknown disconnect reason %d", d)
9494
}
9595
return discReasonToString[d]

0 commit comments

Comments
 (0)