[SERVER-20542] Coverity analysis defect 73711: Unsafe assignment operator Created: 21/Sep/15  Updated: 25/Sep/15  Resolved: 25/Sep/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: Spencer Brody (Inactive)
Resolution: Done 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 73711 (STATIC_C)
Checker SELF_ASSIGN (subcategory none)
File: /src/mongo/executor/network_test_env.h
Function mongo::executor::NetworkTestEnv::FutureHandle<void>::operator =(mongo::executor::NetworkTestEnv::FutureHandle<void>&&)
/src/mongo/executor/network_test_env.h, line: 87
No protection against the object assigning to itself.

                _executor = other._executor;



 Comments   
Comment by Spencer Brody (Inactive) [ 25/Sep/15 ]

The invariant (!_future.valid()) on the line above basically protects us from this being an actual problem

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