[MONGOCRYPT-559] _fle2_mongo_op_markings and _create_markings_cmd_bson are double-initializing bson_t’s Created: 10/Mar/23 Updated: 27/Apr/23 Resolved: 27/Apr/23 |
|
| Status: | Closed |
| Project: | Libmongocrypt |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 1.8.0 |
| Type: | Bug | Priority: | Unknown |
| Reporter: | Zachary Espiritu | Assignee: | Kyle Kloberdanz |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Binding Changes: | Not Needed |
| Description |
|
In mongocrypt-ctx-encrypt.c, a Valgrind memory leak can occur when the libbson BSON_MEMCHECK compile flag is set in two possible ways.
— To reproduce the memory leak, use
|
| Comments |
| Comment by Githook User [ 27/Apr/23 ] |
|
Author: {'name': 'Kyle Kloberdanz', 'email': 'kyle.kloberdanz@mongodb.com', 'username': 'kkloberdanz'}Message: Improve bson_t initialization behavior (#629)
This addresses the issues brought up in the above tickets. We will not be removing calls to `BSON_INITIALIZER`, but we are addressing the other issues uncovered in these tickets. Co-authored-by: Kevin Albertson <kevin.albertson@10gen.com> |
| Comment by Kyle Kloberdanz [ 25/Apr/23 ] |
|
Hello Zachary, thank you for reporting this. I've made sure to clean up several of these issues, and I'll have a PR with the fixes ready soon. However, we prefer to not remove these calls to BSON_INITIALIZER. Since we do not use BSON_MEMCHECK, initializing a bson object with BSON_INITIALIZER doesn't cause us an issue, and it makes the code more robust since it avoids dealing with uninitialized objects. Please also see Kevin's response on another ticket. |