[SERVER-75832] Coverity analysis defect 137540: Unsafe assignment operator Created: 07/Apr/23  Updated: 29/Oct/23  Resolved: 12/May/23

Status: Closed
Project: Core Server
Component/s: Internal Code
Affects Version/s: None
Fix Version/s: 7.1.0-rc0

Type: Bug Priority: Minor - P4
Reporter: Coverity Collector User Assignee: Alyssa Clark
Resolution: Fixed Votes: 0
Labels: coverity, neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File Screenshot 2023-04-07 at 10.13.34 AM.png    
Assigned Teams:
Query Execution
Backwards Compatibility: Fully Compatible
Operating System: ALL
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/exec/document_value/document_metadata_fields.cpp:49: SELF_ASSIGN 137540 No protection against the object assigning to itself.



 Comments   
Comment by Githook User [ 12/May/23 ]

Author:

{'name': 'Alyssa Wagenmaker', 'email': 'alyssa.wagenmaker@mongodb.com', 'username': 'awagenmaker'}

Message: SERVER-75832 Prevent DocumentMetadataFields self-assignment
Branch: master
https://github.com/mongodb/mongo/commit/ac2ef7eeed6c58e0eabf9b47d96d54d2176da07c

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