[CDRIVER-2274] _mongoc_write_command_init() may freeze const mongoc_write_concern_t Created: 11/Sep/17 Updated: 22/Nov/17 Resolved: 09/Oct/17 |
|
| Status: | Closed |
| Project: | C Driver |
| Component/s: | libmongoc |
| Affects Version/s: | 1.7.0 |
| Fix Version/s: | 1.9.0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Jeremy Mikola | Assignee: | Jeremy Mikola |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||
| Description |
|
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). |
| Comments |
| Comment by Jeremy Mikola [ 09/Oct/17 ] |
|
This is no longer an issue thanks to |