Skip to content
This repository

Yajl ignores object-closing } and ], and may return wrong object and/or type #95

Open
vapir opened this Issue January 10, 2012 · 1 comment

2 participants

vapir Geremy Cohen
vapir

the input is missing a trailing } and yajl does not complain:

>> Yajl::Parser.parse %Q({"a":{"a":"a"})
=> {"a"=>{"a"=>"a"}}

the input is missing a trailing ] and yajl does not complain:

>> Yajl::Parser.parse %Q(["a")
=> ["a"]

the input is missing two trailing }s and yajl does not complain, and returns an incomplete, wrong object:

>> Yajl::Parser.parse %Q({"a":{"a":"a")
=> {"a"=>"a"}

and with ]s:

>> Yajl::Parser.parse %Q([["a")
=> ["a"]

the input is missing multiple trailing }s and/or trailing ]s, yajl does not complain, and returns an incomplete, wrong object of the wrong type:

>> Yajl::Parser.parse %Q(["a", {"a":{"a":"a")
=> {"a"=>"a"}
>> Yajl::Parser.parse %Q({"a": [["a")
=> ["a"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.