Skip to content

Commit

Permalink
Fix panic preventing wal file truncation
Browse files Browse the repository at this point in the history
Fixes #5455
  • Loading branch information
jwilder committed Jan 29, 2016
1 parent 0119366 commit 924275b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
- [#5349](https://github.com/influxdata/influxdb/issues/5349): Validate metadata blob for 'influxd backup'
- [#5469](https://github.com/influxdata/influxdb/issues/5469): Conversion from bz1 to tsm doesn't work as described
- [#5449](https://github.com/influxdata/influxdb/issues/5449): panic when dropping collectd points
- [#5455](https://github.com/influxdata/influxdb/issues/5455): panic: runtime error: slice bounds out of range when loading corrupted wal segment

## v0.9.6 [2015-12-09]

Expand Down
4 changes: 4 additions & 0 deletions tsdb/engine/tsm1/wal.go
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,10 @@ func (w *WriteWALEntry) UnmarshalBinary(b []byte) error {
}
case stringEntryType:
length := int(btou32(b[i : i+4]))
if i+length > int(uint32(len(b))) {
return fmt.Errorf("corrupted write wall entry")
}

i += 4
v := string(b[i : i+length])
i += length
Expand Down

0 comments on commit 924275b

Please sign in to comment.