[SERVER-40138] Coverity analysis defect 112182: Unsafe assignment operator Created: 14/Mar/19  Updated: 27/Oct/23  Resolved: 25/Mar/19

Status: Closed
Project: Core Server
Component/s: Internal Code
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Coverity Collector User Assignee: Andrew Morrow (Inactive)
Resolution: Gone away Votes: 0
Labels: coverity
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Problem/Incident
is caused by SERVER-36243 Take advantage of c++14 sized delete ... Closed
Related
is related to SERVER-40197 Reapply work for sized delete Closed
Operating System: ALL
Sprint: Dev Tools 2019-04-08
Participants:

 Description   

Assignment operator does not check for self-assignment

Defect 112182 (STATIC_C)
Checker SELF_ASSIGN (subcategory none)
File: /src/mongo/base/data_builder.h
Function mongo::DataBuilder::BufDeleter::operator =(mongo::DataBuilder::BufDeleter&&)
/src/mongo/base/data_builder.h, line: 66
No protection against the object assigning to itself.

                _capacity = other._capacity;



 Comments   
Comment by Andrew Morrow (Inactive) [ 25/Mar/19 ]

The indicated code was reverted in the revert for SERVER-36243. CC henrik.edin to think about how to avoid this happening again when we redo your work under SERVER-40197.

Generated at Thu Feb 08 04:54:07 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.