[SERVER-37854] Coverity analysis defect 105094: Uninitialized scalar field Created: 01/Nov/18  Updated: 29/Oct/23  Resolved: 12/Nov/18

Status: Closed
Project: Core Server
Component/s: Internal Code
Affects Version/s: None
Fix Version/s: 4.0.5, 4.1.6

Type: Bug Priority: Major - P3
Reporter: Coverity Collector User Assignee: Mark Benvenuto
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:
v4.0
Sprint: Security 2018-11-19
Participants:

 Description   

A scalar field is not initialized by the constructor

Defect 105094 (STATIC_C)
Checker UNINIT_CTOR (subcategory none)
File: /src/mongo/db/free_mon/free_mon_queue.h
Function mongo::FreeMonMessageQueue::FreeMonMessageQueue(bool)
/src/mongo/db/free_mon/free_mon_queue.h, line: 150
Class member declaration for "_counter".

        uint64_t _counter;

/src/mongo/db/free_mon/free_mon_queue.h, line: 106
Non-static class member "_counter" is not initialized in this constructor nor in any functions that it calls.

        FreeMonMessageQueue(bool useCrankForTest = false) : _useCrank(useCrankForTest) {}



 Comments   
Comment by Githook User [ 19/Nov/18 ]

Author:

{'name': 'Mark Benvenuto', 'email': 'mark.benvenuto@mongodb.com', 'username': 'markbenvenuto'}

Message: SERVER-37854 Coverity analysis defect 105094: Uninitialized scalar field

(cherry picked from commit 4cafb0b8f0566d7e480983fc57b94b7bfe78c540)
Branch: v4.0
https://github.com/mongodb/mongo/commit/9d70ab4b796befe1842f2fe93860e62a6376893c

Comment by Githook User [ 12/Nov/18 ]

Author:

{'name': 'Mark Benvenuto', 'email': 'mark.benvenuto@mongodb.com', 'username': 'markbenvenuto'}

Message: SERVER-37854 Coverity analysis defect 105094: Uninitialized scalar field
Branch: master
https://github.com/mongodb/mongo/commit/4cafb0b8f0566d7e480983fc57b94b7bfe78c540

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