diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2019-07-30 18:43:14 +0200 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2019-07-30 18:43:14 +0200 |
| commit | 3b37734422dc0cb40100287bbb3628d8d946c271 (patch) | |
| tree | 2143032873443373cda4b22f10813e89f5cea202 /pkg/ast | |
| parent | 314ea0c9529c34d53b4249bcf3fbfcd356b0c539 (diff) | |
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.
Diffstat (limited to 'pkg/ast')
| -rw-r--r-- | pkg/ast/scanner.go | 1 |
1 files changed, 0 insertions, 1 deletions
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) { |
