[SERVER-69276] Coverity analysis defect 127661: Using a moved object Created: 31/Aug/22  Updated: 29/Oct/23  Resolved: 22/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: Sebastien Mendez
Resolution: Fixed Votes: 0
Labels: coverity, neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File Screen Shot 2022-08-31 at 10.19.27 AM.png    
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: QE 2022-10-03
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/pipeline/document_source_writer.h:106: USE_AFTER_MOVE 127661 "outputNs" is moved (indicated by "std::move(outputNs)").
/src/mongo/db/pipeline/document_source_writer.h:108: USE_AFTER_MOVE 127661 "outputNs" is used after it has been already moved.



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

Author:

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

Message: SERVER-69276 Fixed use-after-move defect in DocumentSourceWriter
Branch: master
https://github.com/mongodb/mongo/commit/a8e766c2749d841307abef825a108b4e749e9463

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