[SERVER-59348] Coverity analysis defect 120375: Uninitialized scalar field Created: 16/Aug/21  Updated: 27/Oct/23  Resolved: 02/Sep/21

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

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

Operating System: ALL
Sprint: Execution Team 2021-09-06
Participants:

 Description   

Uninitialized scalar field

The field will contain an arbitrary value left over from earlier computations. A scalar field is not initialized by the constructor
/src/mongo/bson/util/simple8b.h:272: UNINIT_CTOR 120375 Class member declaration for "_current".
/src/mongo/bson/util/simple8b.cpp:661: UNINIT_CTOR 120375 Non-static class member "_current" is not initialized in this constructor nor in any functions that it calls.
/src/mongo/bson/util/simple8b.h:277: UNINIT_CTOR 120375 Class member declaration for "_mask".
/src/mongo/bson/util/simple8b.cpp:661: UNINIT_CTOR 120375 Non-static class member "_mask" is not initialized in this constructor nor in any functions that it calls.
/src/mongo/bson/util/simple8b.h:287: UNINIT_CTOR 120375 Class member declaration for "_bitsPerValue".
/src/mongo/bson/util/simple8b.cpp:661: UNINIT_CTOR 120375 Non-static class member "_bitsPerValue" is not initialized in this constructor nor in any functions that it calls.
/src/mongo/bson/util/simple8b.h:291: UNINIT_CTOR 120375 Class member declaration for "_countMask".
/src/mongo/bson/util/simple8b.cpp:661: UNINIT_CTOR 120375 Non-static class member "_countMask" is not initialized in this constructor nor in any functions that it calls.
/src/mongo/bson/util/simple8b.h:294: UNINIT_CTOR 120375 Class member declaration for "_countBits".
/src/mongo/bson/util/simple8b.cpp:661: UNINIT_CTOR 120375 Non-static class member "_countBits" is not initialized in this constructor nor in any functions that it calls.
/src/mongo/bson/util/simple8b.h:297: UNINIT_CTOR 120375 Class member declaration for "_countMultiplier".
/src/mongo/bson/util/simple8b.cpp:661: UNINIT_CTOR 120375 Non-static class member "_countMultiplier" is not initialized in this constructor nor in any functions that it calls.
/src/mongo/bson/util/simple8b.h:300: UNINIT_CTOR 120375 Class member declaration for "_selector".
/src/mongo/bson/util/simple8b.cpp:661: UNINIT_CTOR 120375 Non-static class member "_selector" is not initialized in this constructor nor in any functions that it calls.
/src/mongo/bson/util/simple8b.h:303: UNINIT_CTOR 120375 Class member declaration for "_extensionType".
/src/mongo/bson/util/simple8b.cpp:661: UNINIT_CTOR 120375 Non-static class member "_extensionType" is not initialized in this constructor nor in any functions that it calls.



 Comments   
Comment by Henrik Edin [ 02/Sep/21 ]

These members are not initialized for end iterators and not used in comparison. They will be initialized before used in non end iterators. Works as designed.

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