From 7c7ded697e6322b0975f061b7e268fe44f585dab Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Tue, 30 Jul 2019 19:33:02 +0200 Subject: prog: fix out-of-bounds access ParseLog can access data out-of-bounds. Fix that and fix regression fuzz tests to catch this. --- prog/parse.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'prog/parse.go') 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 } -- cgit mrf-deployment