hcl/json
Alisdair McDiarmid b265bbd046 json: Fix panic when parsing malformed JSON
When scanning JSON, upon encountering an invalid token, we immediately
return. Previously this return happened without inserting an EOF token.
Since other functions assume that a token sequence always ends in EOF,
this could cause a panic.

This commit adds a synthetic EOF token after the invalid token before
returning. While this does not match the real end-of-file of the source
JSON, it is marking the end of the scanned bytes, so it seems reasonable.

Fixes #339
2020-03-25 16:40:36 -04:00
..
fuzz Unfold the "hcl" directory up into the root 2019-09-09 16:08:19 -07:00
ast.go Unfold the "hcl" directory up into the root 2019-09-09 16:08:19 -07:00
didyoumean_test.go Unfold the "hcl" directory up into the root 2019-09-09 16:08:19 -07:00
didyoumean.go Unfold the "hcl" directory up into the root 2019-09-09 16:08:19 -07:00
doc.go json: Clarify that this package is not interesting to import 2019-10-01 15:59:10 -07:00
navigation_test.go Unfold the "hcl" directory up into the root 2019-09-09 16:08:19 -07:00
navigation.go Unfold the "hcl" directory up into the root 2019-09-09 16:08:19 -07:00
parser_test.go Unfold the "hcl" directory up into the root 2019-09-09 16:08:19 -07:00
parser.go Unfold the "hcl" directory up into the root 2019-09-09 16:08:19 -07:00
peeker.go Unfold the "hcl" directory up into the root 2019-09-09 16:08:19 -07:00
public_test.go json: Fix panic when parsing malformed JSON 2020-03-25 16:40:36 -04:00
public.go Unfold the "hcl" directory up into the root 2019-09-09 16:08:19 -07:00
scanner_test.go json: Fix panic when parsing malformed JSON 2020-03-25 16:40:36 -04:00
scanner.go json: Fix panic when parsing malformed JSON 2020-03-25 16:40:36 -04:00
spec.md Unfold the "hcl" directory up into the root 2019-09-09 16:08:19 -07:00
structure_test.go Unfold the "hcl" directory up into the root 2019-09-09 16:08:19 -07:00
structure.go Unfold the "hcl" directory up into the root 2019-09-09 16:08:19 -07:00
tokentype_string.go Unfold the "hcl" directory up into the root 2019-09-09 16:08:19 -07:00