[SERVER-69207] Coverity analysis defect 122696: Using a moved object Created: 26/Aug/22  Updated: 29/Oct/23  Resolved: 12/Sep/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 6.0.2, 6.1.0-rc2, 6.2.0-rc0

Type: Bug Priority: Major - P3
Reporter: Coverity Collector User Assignee: Sergi Mateo Bellido
Resolution: Fixed Votes: 0
Labels: coverity
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v6.1, v6.0
Sprint: Sharding EMEA 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/s/catalog/type_collection.cpp:52: USE_AFTER_MOVE 122696 "creationTime" is moved (indicated by "std::move(creationTime)").
/src/mongo/s/catalog/type_collection.cpp:57: USE_AFTER_MOVE 122696 "creationTime" is used after it has been already moved.



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

Author:

{'name': 'Sergi Mateo Bellido', 'email': 'sergi.mateo-bellido@mongodb.com', 'username': 'smateo'}

Message: SERVER-69207 Coverity fix use after move

(cherry picked from commit 310dd9f04ad50187706ae5e839a68171b356dbf0)
Branch: v6.1
https://github.com/mongodb/mongo/commit/8a86f72b69887a8c9c513876b6e88955d200d012

Comment by Githook User [ 12/Sep/22 ]

Author:

{'name': 'Sergi Mateo Bellido', 'email': 'sergi.mateo-bellido@mongodb.com', 'username': 'smateo'}

Message: SERVER-69207 Coverity fix use after move

(cherry picked from commit 310dd9f04ad50187706ae5e839a68171b356dbf0)
Branch: v6.0
https://github.com/mongodb/mongo/commit/2ef7e19c54cfa3e96cd41819f4ab14bdc2d95f9f

Comment by Githook User [ 12/Sep/22 ]

Author:

{'name': 'Sergi Mateo Bellido', 'email': 'sergi.mateo-bellido@mongodb.com', 'username': 'smateo'}

Message: SERVER-69207 Coverity fix use after move
Branch: master
https://github.com/mongodb/mongo/commit/310dd9f04ad50187706ae5e839a68171b356dbf0

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