[SERVER-34641] Coverity analysis defect 103536: Uninitialized scalar variable Created: 24/Apr/18  Updated: 29/Oct/23  Resolved: 27/Apr/18

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: None
Fix Version/s: 4.0.0-rc0

Type: Bug Priority: Major - P3
Reporter: Coverity Collector User Assignee: Matthew Saltz (Inactive)
Resolution: Fixed Votes: 0
Labels: coverity
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Participants:

 Description   

Use of an uninitialized variable

Defect 103536 (STATIC_C)
Checker UNINIT (subcategory none)
File: /src/mongo/s/catalog_cache.cpp
Function mongo::CatalogCache::_getDatabase(mongo::OperationContext *, mongo::StringData)
/src/mongo/s/catalog_cache.cpp, line: 131
Declaring variable "refreshActionTaken" without initializer.

        DatabaseInfoRefreshAction refreshActionTaken;

/src/mongo/s/catalog_cache.cpp, line: 186
Using uninitialized value "refreshActionTaken".

                return {CachedDatabaseInfo(*dbEntry->dbt, std::move(primaryShard)), refreshActionTaken};



 Comments   
Comment by Matthew Saltz (Inactive) [ 27/Apr/18 ]

Change that caused this was reverted in this commit: https://github.com/mongodb/mongo/commit/316bcc98e2b89e266493612ee1cf4680a0265e0f

Generated at Thu Feb 08 04:37:21 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.