mongoc_collection_validate doesn't always init "reply"

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Minor - P4
    • 1.4.0
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • 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

              Assignee:
              Ian Boros
              Reporter:
              Ian Boros
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: