[SERVER-70231] Coverity analysis defect 122778: Using a moved object Created: 05/Oct/22  Updated: 29/Oct/23  Resolved: 21/Oct/22

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

Type: Bug Priority: Major - P3
Reporter: Coverity Collector User Assignee: Wenqin Ye
Resolution: Fixed Votes: 0
Labels: coverity, neweng, sharding-nyc-subteam2
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File Screen Shot 2022-10-05 at 10.14.06 AM.png    
Backwards Compatibility: Minor Change
Operating System: ALL
Participants:
Story Points: 1

 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/session/session_catalog.h:160: USE_AFTER_MOVE 122778 "lsid" is moved (indicated by "std::move(lsid)").
/src/mongo/db/session/session_catalog.h:162: USE_AFTER_MOVE 122778 "lsid" is used after it has been already moved.



 Comments   
Comment by Githook User [ 20/Oct/22 ]

Author:

{'name': 'wenqinYe', 'email': 'wenqin908@gmail.com', 'username': 'wenqinYe'}

Message: SERVER-70231 Fix Coverity analysis defect 122778: Using a moved object
Branch: master
https://github.com/mongodb/mongo/commit/0c155f9fc442bb17a2b57d904766372913c7ae03

Comment by Kyle Suarez [ 05/Oct/22 ]

Wasn't sure who owned SessionCatalog so I guessed sharding

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