From 3b37734422dc0cb40100287bbb3628d8d946c271 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Tue, 30 Jul 2019 18:43:14 +0200 Subject: pkg/ast: fix out-of-bounds access Scanner can access data out of bounds on bad input. Also fix regression fuzz test to be able to detect the bug. --- pkg/ast/scanner.go | 1 - 1 file changed, 1 deletion(-) (limited to 'pkg/ast') diff --git a/pkg/ast/scanner.go b/pkg/ast/scanner.go index 0d0054376..a9448b34f 100644 --- a/pkg/ast/scanner.go +++ b/pkg/ast/scanner.go @@ -279,7 +279,6 @@ func (s *scanner) next() { // Makes lots of things simpler as we always // want to treat EOF as NEWLINE as well. s.ch = '\n' - s.off++ return } if s.off > len(s.data) { -- cgit mrf-deployment