Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pure implementation should reject JSON with missing closing tokens ("{" and "[") #314

Closed
backus opened this issue Jan 17, 2017 · 1 comment

Comments

@backus
Copy link

backus commented Jan 17, 2017

The C extension JSON parser behaves as expected:

require 'json'

JSON::VERSION   # => "2.0.3"
JSON.parse('[') # !> 409: unexpected token at '' (JSON::ParserError)
JSON.parse('{') # !> 743: unexpected token at '{' (JSON::ParserError)

The pure implementation does not:

require 'json/pure'

JSON::VERSION   # => "2.0.3"
JSON.parse('{') # => {}
JSON.parse('[') # => []
@marcandre
Copy link
Member

Confirmed in master

@hsbt hsbt closed this as completed in 5b4f1ba Aug 14, 2020
hsbt added a commit that referenced this issue Aug 14, 2020
Fix pure parser with unclosed arrays / objects [Fix #314]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants