[SERVER-68048] Coverity analysis defect 122536: Unsafe assignment operator Created: 14/Jul/22  Updated: 26/Jul/22  Resolved: 26/Jul/22

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

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

Attachments: PNG File Screen Shot 2022-07-14 at 9.26.20 AM.png    
Issue Links:
Depends
depends on SERVER-67497 Refactor the hist-ce prototype to sep... Closed
Problem/Incident
is caused by SERVER-66957 Histogram-based CE for SargableNodes ... Closed
is caused by SERVER-67497 Refactor the hist-ce prototype to sep... Closed
Operating System: ALL
Sprint: QO 2022-08-08
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/ce/utils.cpp:77: SELF_ASSIGN 122536 No protection against the object assigning to itself.



 Comments   
Comment by Alya Berciu [ 26/Jul/22 ]

Closing as a duplicate of SERVER-67497, which has been merged.

Comment by Alya Berciu [ 25/Jul/22 ]

This should trivially be fixed by SERVER-67497 because the current PR deletes the SBEValue class (we don't currently need it for CE as it turns out).

EDIT: Leaving this open for now instead of closing as duplicate because I'm not sure if the ticket would just be regenerated if I close it before merging that fix.

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