[SERVER-51180] Coverity analysis defect 116392: Uninitialized pointer field Created: 28/Sep/20  Updated: 29/Oct/23  Resolved: 13/Oct/20

Status: Closed
Project: Core Server
Component/s: Catalog
Affects Version/s: None
Fix Version/s: 4.9.0

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

Issue Links:
Duplicate
duplicates SERVER-49960 Coverity analysis defect 115281: Unin... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Execution Team 2020-10-19
Participants:

 Description   

Uninitialized pointer field

The pointer field will point to an arbitrary memory location, any attempt to write may cause corruption. A pointer field is not initialized in the constructor
/src/mongo/db/catalog/collection_catalog.h:114: UNINIT_CTOR 116392 Class member declaration for "_genNum".
/src/mongo/db/catalog/collection_catalog.cpp:109: UNINIT_CTOR 116392 Non-static class member "_genNum" is not initialized in this constructor nor in any functions that it calls.
/src/mongo/db/catalog/collection_catalog.h:117: UNINIT_CTOR 116392 Class member declaration for "_catalog".
/src/mongo/db/catalog/collection_catalog.cpp:109: UNINIT_CTOR 116392 Non-static class member "_catalog" is not initialized in this constructor nor in any functions that it calls.



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

Author:

{'name': 'Henrik Edin', 'email': 'henrik.edin@mongodb.com', 'username': 'henrikedin'}

Message: SERVER-51180 Fix uninitialized variables in CollectionCatalog::iterator when using constructor for end iterator.

They were basically harmless but would cause problem if iterators are compared other way around. This will make the comparison operator symmetric.
Branch: master
https://github.com/mongodb/mongo/commit/0f0db59f8fc1166f05c45049e9ae230cf9c6e9f0

Generated at Thu Feb 08 05:24:45 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.