[SERVER-68898] Coverity analysis defect 122779: Using a moved object Created: 17/Aug/22  Updated: 29/Oct/23  Resolved: 07/Sep/22

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

Type: Bug Priority: Major - P3
Reporter: Coverity Collector User Assignee: Anton Korshunov
Resolution: Fixed Votes: 0
Labels: coverity, neweng, quick-tech-debt
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File Screen Shot 2022-08-17 at 10.19.57 AM.png    
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: QO 2022-09-19
Participants:

 Description   

Using a moved object

Using a moved object may lead to an unexpected/undefined behavior. An object is used after it's moved.
/src/mongo/db/query/optimizer/node.cpp:560: USE_AFTER_MOVE 122779 "children" is moved (indicated by "std::move(children)").
/src/mongo/db/query/optimizer/node.cpp:560: USE_AFTER_MOVE 122779 "children" is used after it has been already moved.



 Comments   
Comment by Githook User [ 07/Sep/22 ]

Author:

{'name': 'Anton Korshunov', 'email': 'anton.korshunov@mongodb.com', 'username': 'antkorsh'}

Message: SERVER-68898 Fix use-after-move in UnionNode constructor
Branch: master
https://github.com/mongodb/mongo/commit/f5958b78605e36b9cb462d019a07cc2f3db06427

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