[CDRIVER-1942] JSON can be parsed despite stray "}" characters Created: 07/Dec/16  Updated: 07/Dec/16  Resolved: 07/Dec/16

Status: Closed
Project: C Driver
Component/s: json
Affects Version/s: None
Fix Version/s: 1.6.0

Type: Bug Priority: Minor - P4
Reporter: A. Jesse Jiryu Davis Assignee: A. Jesse Jiryu Davis
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on CDRIVER-1370 Replace libyajl with jsonsl Closed

 Description   

Invalid JSON like this is accepted by our parser:

{"aggregate": "collection", "pipeline": [{"a": 1}]},"collation": {"locale": "en"}

There's a stray "}" after the pipeline, and the closing "}" is missing, but it's parsed as if valid.



 Comments   
Comment by A. Jesse Jiryu Davis [ 07/Dec/16 ]

Fixed by porting from YAJL to JSONSL.

Some invalid JSON used in libmongoc tests required corrections:

https://github.com/mongodb/mongo-c-driver/commit/10b4f2336618219434b29cadee5eb1d0f5c6931d

Comment by Githook User [ 07/Dec/16 ]

Author:

{u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}

Message: CDRIVER-1942 note that JSON parsing is now stricter
Branch: master
https://github.com/mongodb/libbson/commit/afeb1e44f2875e2feff15e0d3eb9eb9c28826f20

Generated at Wed Feb 07 21:13:41 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.