[SERVER-27278] Coverity analysis defect 100076: Unsafe assignment operator Created: 05/Dec/16  Updated: 05/Apr/17  Resolved: 07/Dec/16

Status: Closed
Project: Core Server
Component/s: Querying
Affects Version/s: None
Fix Version/s: 3.5.1

Type: Bug Priority: Major - P3
Reporter: Coverity Collector User Assignee: David Storch
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
Sprint: Query 2016-12-12
Participants:

 Description   

Assignment operator does not check for self-assignment

Defect 100076 (STATIC_C)
Checker SELF_ASSIGN (subcategory none)
File: /src/mongo/db/clientcursor.cpp
Function mongo::ClientCursorPin::operator =(mongo::ClientCursorPin&&)
/src/mongo/db/clientcursor.cpp, line: 198
No protection against the object assigning to itself.

        _cursor = other._cursor;



 Comments   
Comment by Githook User [ 07/Dec/16 ]

Author:

{u'username': u'dstorch', u'name': u'David Storch', u'email': u'david.storch@10gen.com'}

Message: SERVER-27278 check for assignment to self in ClientCursorPin move assignment operator
Branch: master
https://github.com/mongodb/mongo/commit/2742eb1e0bfe5998a9c1e7a24c1f2589632b6715

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