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

_mongoc_write_command_init() may freeze const mongoc_write_concern_t

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • 1.9.0
    • Affects Version/s: 1.7.0
    • Component/s: libmongoc
    • Labels:
      None

      The WRITE_CONCERN_DOC() macro in mongoc-write-command.c casts a const mongoc_write_concern_t* to mongoc_write_concern_t* in order to call _mongoc_write_concern_get_bson(), which may modify the state of the write concern by freezing it.

      It would be preferable if this used _BSON_APPEND_WRITE_CONCERN(), which makes a temporary copy of the write concern if it is not already frozen (thereby leaving a non-frozen write concern as-is).

            Assignee:
            jmikola@mongodb.com Jeremy Mikola
            Reporter:
            jmikola@mongodb.com Jeremy Mikola
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: