[SERVER-20047] Coverity analysis defect 73462: Unsafe assignment operator Created: 19/Aug/15  Updated: 19/Aug/15  Resolved: 19/Aug/15

Status: Closed
Project: Core Server
Component/s: Testing Infrastructure
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Coverity Collector User Assignee: Adam Midvidy
Resolution: Won't Fix Votes: 0
Labels: coverity
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Participants:

 Description   

Assignment operator does not check for self-assignment

Defect 73462 (STATIC_C)
Checker SELF_ASSIGN (subcategory none)
File: /src/mongo/util/net/message.h
Function mongo::Message::operator =(mongo::Message&&)
/src/mongo/util/net/message.h, line: 420
No protection against the object assigning to itself.

            _buf = r._buf;



 Comments   
Comment by Adam Midvidy [ 19/Aug/15 ]

Not going to fix as we don't want to pay the overhead of checking for self moves.

Generated at Thu Feb 08 03:52:59 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.