Original title: "Calling mongoc_collection_insert with a document which contains hundreds of levels of nested BSON documents causes stack overflow"
I know that MongoDB only supports up to 100 levels of nesting for BSON documents but if someone unknowingly calls mongoc_collection_insert() and passes a document with >500 levels of nesting, then it causes stack overflow.
The overflow happens while validating the BSON document. If I disable the validation by passing in MONGOC_INSERT_NO_VALIDATE, then of course, it doesn't crash.
I understand that this is unsupported behavior, but it would be nice if it didn't cause stack overflow.
- is related to
-
CDRIVER-2814 No simple way to validate a BSON document without crashing
- Closed