Skip to content

Commit

Permalink
disallow negative indexes
Browse files Browse the repository at this point in the history
  • Loading branch information
jrick committed Jun 27, 2020
1 parent 79b5de4 commit 74068e6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion zkclient/settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ func ObtainSettings() (*Settings, error) {
if err != nil {
return nil, fmt.Errorf("groups: %q: %v", group, err)
}
if n == 0 || n > len(groups)+1 {
if n <= 0 || n > len(groups)+1 {
return nil, fmt.Errorf("groups: %q: window %d unusable", group, n)
}
g := &openGroups[n-1]
Expand Down

0 comments on commit 74068e6

Please sign in to comment.