Uploaded image for project: 'C Driver'
  1. C Driver
  2. CDRIVER-1328

mongoc_collection_validate doesn't always init "reply"

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 1.4.0
    • Affects Version/s: None
    • Component/s: None
    • Labels:

      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@mongodb.com Ian Boros
            Reporter:
            ian.boros@mongodb.com Ian Boros
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: