[SERVER-29325] Coverity analysis defect 101639: Uninitialized scalar variable Created: 23/May/17  Updated: 30/Oct/23  Resolved: 26/Jun/17

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: None
Fix Version/s: 3.5.10

Type: Bug Priority: Major - P3
Reporter: Coverity Collector User Assignee: Dianna Hohensee (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
Sprint: Sharding 2017-07-10
Participants:

 Description   

Use of an uninitialized variable

Defect 101639 (STATIC_C)
Checker UNINIT (subcategory none)
File: /src/mongo/db/s/shard_server_catalog_cache_loader.cpp
Function mongo::ShardServerCatalogCacheLoader::TaskList::getEnqueuedMetadataForTerm(long long) const
/src/mongo/db/s/shard_server_catalog_cache_loader.cpp, line: 687
Declaring variable "collAndChunks".

        CollectionAndChangedChunks collAndChunks;



 Comments   
Comment by Githook User [ 26/Jun/17 ]

Author:

{u'username': u'DiannaHohensee', u'name': u'Dianna Hohensee', u'email': u'dianna.hohensee@10gen.com'}

Message: SERVER-29325 add constructors for CollectionAndChangedChunks struct
Branch: master
https://github.com/mongodb/mongo/commit/862af7cdac5b9b9740335fd476209cd455f84c91

Comment by Dianna Hohensee (Inactive) [ 23/Jun/17 ]

The problem is that the boolean 'shardKeyIsUnique' field in the struct goes uninitialized.

Adding two constructors, default with shardKeyIsUnique(false), and one that sets all the fields to specific values.

Comment by Eric Milkie [ 23/May/17 ]

"CollectionAndChangedChunks" is a struct with no initializers for POD types in its constructor.

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