[CDRIVER-2310] Return error instead of asserting for malformed JSON Created: 03/Oct/17  Updated: 28/Oct/23  Resolved: 10/Oct/17

Status: Closed
Project: C Driver
Component/s: libbson
Affects Version/s: None
Fix Version/s: 1.9.0

Type: Bug Priority: Major - P3
Reporter: Kevin Albertson Assignee: Kevin Albertson
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Problem/Incident

 Description   

In some cases of malformed JSON we're asserting instead of returning a useful error message.

Some repros:

[],[{'abc': 1}]
{},[{'abc': 1}]

Passing these via json-to-bson will trigger asserts.



 Comments   
Comment by Githook User [ 10/Oct/17 ]

Author:

{'email': 'kevin.albertson@10gen.com', 'name': 'Kevin Albertson', 'username': 'kevinAlbs'}

Message: CDRIVER-2310 Avoid assert for case of bad json
Branch: master
https://github.com/mongodb/libbson/commit/b10532b10f2de67327a8b44818575d085509931a

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