[SERVER-78676] Replace c-string constructor with fill constructor in CurrentOpExhaustCursorTestFixture::initTestCollection on v5.0 Created: 05/Jul/23 Updated: 29/Oct/23 Resolved: 31/Jul/23 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 4.4.24, 5.0.20 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Davis Haupt (Inactive) | Assignee: | Davis Haupt (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | greenerbuild | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Assigned Teams: |
Query Integration
|
||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||
| Operating System: | ALL | ||||||||
| Backport Requested: |
v4.4
|
||||||||
| Sprint: | QI 2023-07-10, QI 2023-07-24, QI 2023-08-07 | ||||||||
| Participants: | |||||||||
| Linked BF Score: | 51 | ||||||||
| Description |
|
We're creating a std::string of a certain large size, but only initializing it with a string of size 1 here. From the std::string constructor docs, it looks like instead of std::string("A", size), we should use std::string(size, "A") to fill the string with the string "A" repeated. Note that this code doesn't exist on versions after 5.0, and so will only need to change on v5.0 and v4.4. |
| Comments |
| Comment by Githook User [ 10/Aug/23 ] |
|
Author: {'name': 'Davis Haupt', 'email': 'davis.haupt@mongodb.com', 'username': 'davish'}Message: Using the constructor std::string(char*, size_t) was causing a buffer overflow when the string was not as long as the size passed in. |
| Comment by Githook User [ 31/Jul/23 ] |
|
Author: {'name': 'Davis Haupt', 'email': 'davis.haupt@mongodb.com', 'username': 'davish'}Message: Using the constructor std::string(char*, size_t) was causing a buffer overflow when the string was not as long as the size passed in. |