-
Type: Bug
-
Resolution: Done
-
Priority: Minor - P4
-
Affects Version/s: None
-
Component/s: None
The documentation for mongoc_collection_validate says:
reply [an argument] is always initialized and must be destroyed with bson_destroy().
(see https://api.mongodb.com/c/current/mongoc_collection_validate.html)
The implementation doesn't always initialize reply. In particular, if the options passed are invalid, then reply is left alone, which means if a client tries to bson_destroy() it, they might end up accessing uninitialized memory.
I think this is like a one-line fix, but there might be bugs just like this one all over