[SERVER-56836] Coverity analysis defect 120038: Unsafe assignment operator Created: 11/May/21  Updated: 29/Oct/23  Resolved: 20/May/21

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 5.0.0-rc0, 5.1.0-rc0

Type: Bug Priority: Major - P3
Reporter: Coverity Collector User Assignee: Henrik Edin
Resolution: Fixed Votes: 0
Labels: coverity
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v5.0
Sprint: Execution Team 2021-05-31
Participants:

 Description   

Unsafe assignment operator

This user-written assignment operator does not check for self-assignment. If an object of this type is assigned to itself use-after-free errors may occur if the class owns resources. Assignment operator does not check for self-assignment
/src/mongo/db/timeseries/minmax.cpp:211: SELF_ASSIGN 120038 No protection against the object assigning to itself.



 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 [ 24/May/21 ]

Author:

{'name': 'Henrik Edin', 'email': 'henrik.edin@mongodb.com', 'username': 'henrikedin'}

Message: SERVER-56836 SERVER-56837 Add self-assignment checks in MinMaxStore.

(cherry picked from commit 576bfe9b642f8cebf5060c6878a128c1b27ed1d0)
Branch: v5.0
https://github.com/mongodb/mongo/commit/f1806516ce775635d62254e615fd1a6a099acada

Comment by Githook User [ 20/May/21 ]

Author:

{'name': 'Henrik Edin', 'email': 'henrik.edin@mongodb.com', 'username': 'henrikedin'}

Message: SERVER-56836 SERVER-56837 Add self-assignment checks in MinMaxStore.
Branch: master
https://github.com/mongodb/mongo/commit/576bfe9b642f8cebf5060c6878a128c1b27ed1d0

Generated at Thu Feb 08 05:40:19 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.