-
Type: Bug
-
Resolution: Won't Fix
-
Priority: Major - P3
-
None
-
Affects Version/s: 1.12.0
-
Component/s: libmongoc
-
None
-
Environment:Windows 10
If I call bson_validate() with a document with more than 500 levels of nesting, it crashes.
I had created a separate bug for insert (CDRIVER-2701) and the workaround suggested was too complicated and not very efficient. It seems strange to me that we need to validate the document before calling the validate function( whose job it is to say whether the document is valid or not) just to prevent it from crashing.
So in effect, bson_validate() only works on already validated documents.
I think this is a serious issue which needs to be fixed. I understand that there are inconsistencies in what MongoDB server does and what Extended JSON Spec says. But I think using the maximum depth of 180 like MongoDB server does is much better than letting it crash or requiring users to validate the document before calling bson_validate(). I don't think the change will make what the Extended JSON Spec any more untrue than what it is today.
- related to
-
CDRIVER-2701 Add example of validating BSON nesting depth with bson_visitor_t
- Closed