[SERVER-71699] Coverity analysis defect 134241: Unsafe assignment operator Created: 30/Nov/22  Updated: 29/Oct/23  Resolved: 18/Jan/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 6.3.0-rc0

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

Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: QE 2022-12-26, QE 2023-01-09, QE 2023-01-23
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/query/stats/value_utils.cpp:63: SELF_ASSIGN 134241 No protection against the object assigning to itself.



 Comments   
Comment by Githook User [ 17/Jan/23 ]

Author:

{'name': 'Sebastien Mendez', 'email': 'sebastien.mendez@mongodb.com', 'username': 'rakiz'}

Message: SERVER-71699 Fix SBEValue assignment operator to support self-assignment
Branch: master
https://github.com/mongodb/mongo/commit/368e0bdc94f6a8e5db492766f639ae7caa69ffdc

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