diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2019-07-30 19:33:02 +0200 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2019-07-30 19:33:02 +0200 |
| commit | 7c7ded697e6322b0975f061b7e268fe44f585dab (patch) | |
| tree | 400f141578159dce58b9ab2a2ba32842e29b1149 /prog/parse.go | |
| parent | 3b37734422dc0cb40100287bbb3628d8d946c271 (diff) | |
prog: fix out-of-bounds access
ParseLog can access data out-of-bounds.
Fix that and fix regression fuzz tests to catch this.
Diffstat (limited to 'prog/parse.go')
| -rw-r--r-- | prog/parse.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/prog/parse.go b/prog/parse.go index 8a8fdf9b1..7a46322df 100644 --- a/prog/parse.go +++ b/prog/parse.go @@ -26,7 +26,7 @@ func (target *Target) ParseLog(data []byte) []*LogEntry { for pos := 0; pos < len(data); { nl := bytes.IndexByte(data[pos:], '\n') if nl == -1 { - nl = len(data) + nl = len(data) - 1 } else { nl += pos } |
