[SERVER-49770] Coverity analysis defect 115958: Copy without assign (Head) Created: 21/Jul/20 Updated: 29/Oct/23 Resolved: 23/Jul/21 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 5.1.0-rc0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Coverity Collector User | Assignee: | Henrik Edin |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | coverity, neweng | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Backwards Compatibility: | Fully Compatible |
| Operating System: | ALL |
| Sprint: | Execution Team 2021-06-14, Execution Team 2021-07-12, Execution Team 2021-07-26, Execution Team 2021-08-09 |
| Participants: |
| Description |
|
Copy without assign This class has a user-defined copy constructor but no user-defined assignment operator. If the copy constructor is necessary to manage owned resources then a corresponding assignment operator is usually required. If an object of this type is assigned memory leaks and/or use-after-free errors may occur. Note that a compiler-generated assignment operator will perform only a bit-wise copy for any fields that do not have their own assignment operators defined. Class has user-written copy constructor but no user-written assignment operator |
| Comments |
| Comment by Vivian Ge (Inactive) [ 06/Oct/21 ] |
|
Updating the fixversion since branching activities occurred yesterday. This ticket will be in rc0 when it’s been triggered. For more active release information, please keep an eye on #server-release. Thank you! |
| Comment by Githook User [ 22/Jul/21 ] |
|
Author: {'name': 'Henrik Edin', 'email': 'henrik.edin@mongodb.com', 'username': 'henrikedin'}Message: Not worth to add at this point as the code does not need them. |
| Comment by Henrik Edin [ 21/Jul/20 ] |
|
We should add a copy assignment operator to the Head class as there is a user defined copy constructor. |