[SERVER-66306] Coverity analysis defect 122182: Uninitialized scalar variable Created: 09/May/22  Updated: 29/Oct/23  Resolved: 09/May/22

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

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

Attachments: PNG File Screen Shot 2022-05-09 at 10.21.05 AM.png    
Issue Links:
Problem/Incident
is caused by SERVER-66021 Implement insert/update/delete with a... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Participants:

 Description   

Uninitialized scalar variable

The variable will contain an arbitrary value left from earlier computations. Use of an uninitialized variable
/src/mongo/db/index/columns_access_method.cpp:178: UNINIT 122182 Declaring variable "numInserted" without initializer.
/src/mongo/db/index/columns_access_method.cpp:187: UNINIT 122182 Using uninitialized value "numInserted".



 Comments   
Comment by Githook User [ 09/May/22 ]

Author:

{'name': 'Charlie Swanson', 'email': 'charlie.swanson@mongodb.com', 'username': 'cswanson310'}

Message: SERVER-66306 Initialize counter to 0
Branch: master
https://github.com/mongodb/mongo/commit/5110465b4a116b94c9d97d59933d8fd41ab99c9d

Comment by Kyle Suarez [ 09/May/22 ]

I believe the increment on line 183 is also undefined since the start value of numInserted is garbage.

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