[SERVER-76352] Improve BSONElement constructor that allows you to optionally provide internal sizes Created: 20/Apr/23 Updated: 21/Apr/23 |
|
| Status: | Backlog |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Henrik Edin | Assignee: | Backlog - Storage Execution Team |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | neweng, techdebt | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Assigned Teams: |
Storage Execution
|
| Participants: |
| Description |
|
The BSONElement constructor that allows you to optionally provide fieldName and value sizes optionally using -1 are unsafe. They do not provide a buffer size parameter to make sure we do not read out-of-bounds for the provided input buffer. The API can be improved to provide other functions to calculate these sizes so we can also get rid of a bunch of unnecessary branching. |