Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix panic: runtime error: slice bounds out of range #9117

Merged
merged 2 commits into from
Nov 15, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@

- [#9065](https://github.com/influxdata/influxdb/pull/9065): Refuse extra arguments to influx CLI

## v1.4.2 [unreleased]

### Bugfixes

- [#9117](https://github.com/influxdata/influxdb/pull/9117): Fix panic: runtime error: slice bounds out of range

## v1.4.1 [2017-11-13]

### Bugfixes
Expand Down
12 changes: 6 additions & 6 deletions tsdb/engine/tsm1/encoding.gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ func (a Values) search(v int64) int {
// a[len-1].UnixNano() < min then FindRange returns (-1, -1)
// indicating the array is outside the [min, max].
func (a Values) FindRange(min, max int64) (int, int) {
if len(a) == 0 {
if len(a) == 0 || min > max {
return -1, -1
}

Expand Down Expand Up @@ -374,7 +374,7 @@ func (a FloatValues) search(v int64) int {
// a[len-1].UnixNano() < min then FindRange returns (-1, -1)
// indicating the array is outside the [min, max].
func (a FloatValues) FindRange(min, max int64) (int, int) {
if len(a) == 0 {
if len(a) == 0 || min > max {
return -1, -1
}

Expand Down Expand Up @@ -630,7 +630,7 @@ func (a IntegerValues) search(v int64) int {
// a[len-1].UnixNano() < min then FindRange returns (-1, -1)
// indicating the array is outside the [min, max].
func (a IntegerValues) FindRange(min, max int64) (int, int) {
if len(a) == 0 {
if len(a) == 0 || min > max {
return -1, -1
}

Expand Down Expand Up @@ -886,7 +886,7 @@ func (a UnsignedValues) search(v int64) int {
// a[len-1].UnixNano() < min then FindRange returns (-1, -1)
// indicating the array is outside the [min, max].
func (a UnsignedValues) FindRange(min, max int64) (int, int) {
if len(a) == 0 {
if len(a) == 0 || min > max {
return -1, -1
}

Expand Down Expand Up @@ -1142,7 +1142,7 @@ func (a StringValues) search(v int64) int {
// a[len-1].UnixNano() < min then FindRange returns (-1, -1)
// indicating the array is outside the [min, max].
func (a StringValues) FindRange(min, max int64) (int, int) {
if len(a) == 0 {
if len(a) == 0 || min > max {
return -1, -1
}

Expand Down Expand Up @@ -1398,7 +1398,7 @@ func (a BooleanValues) search(v int64) int {
// a[len-1].UnixNano() < min then FindRange returns (-1, -1)
// indicating the array is outside the [min, max].
func (a BooleanValues) FindRange(min, max int64) (int, int) {
if len(a) == 0 {
if len(a) == 0 || min > max {
return -1, -1
}

Expand Down
2 changes: 1 addition & 1 deletion tsdb/engine/tsm1/encoding.gen.go.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ func (a {{.Name}}Values) search(v int64) int {
// a[len-1].UnixNano() < min then FindRange returns (-1, -1)
// indicating the array is outside the [min, max].
func (a {{.Name}}Values) FindRange(min, max int64) (int, int) {
if len(a) == 0 {
if len(a) == 0 || min > max {
return -1, -1
}

Expand Down
1 change: 1 addition & 0 deletions tsdb/engine/tsm1/encoding.gen_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ func TestIntegerValues_Exclude(t *testing.T) {
min, max int64
exp []int64
}{
{"excl bad range", 18, 11, []int64{10, 12, 14, 16, 18}},
{"excl none-lo", 0, 9, []int64{10, 12, 14, 16, 18}},
{"excl none-hi", 19, 30, []int64{10, 12, 14, 16, 18}},
{"excl first", 0, 10, []int64{12, 14, 16, 18}},
Expand Down