You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Given the following input, the JSON parser panics:
{
"http_proxy_url: "http://xxxxxx",
}
Note that the property name string is not closed, and so presumably the parser is still in the string literal parsing state when it reaches the end of the buffer.
The panic stack trace reported in the Terraform issue is:
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
Originally reported over in hashicorp/terraform#23964.
Given the following input, the JSON parser panics:
Note that the property name string is not closed, and so presumably the parser is still in the string literal parsing state when it reaches the end of the buffer.
The panic stack trace reported in the Terraform issue is:
In the situation where this was reported, Terraform was parsing a
.tfvars.json
file.The text was updated successfully, but these errors were encountered: