[SERVER-49796] Coverity analysis defect 115964: Uninitialized scalar field _reversePos Created: 22/Jul/20  Updated: 29/Oct/23  Resolved: 10/Jun/21

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

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

Issue Links:
Duplicate
is duplicated by SERVER-56609 Coverity analysis defect 119305: Unin... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Execution Team 2021-06-14
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/db/storage/ephemeral_for_test/ephemeral_for_test_sorted_impl.cpp:846: UNINIT_CTOR 115964 Class member declaration for "_reversePos".
/src/mongo/db/storage/ephemeral_for_test/ephemeral_for_test_sorted_impl.cpp:807: UNINIT_CTOR 115964 Non-static class member "_reversePos" is not initialized in this constructor nor in any functions that it calls.



 Comments   
Comment by Vivian Ge (Inactive) [ 06/Oct/21 ]

Updating the fixversion since branching activities occurred yesterday. This ticket will be in rc0 when it’s been triggered. For more active release information, please keep an eye on #server-release. Thank you!

Comment by Githook User [ 10/Jun/21 ]

Author:

{'name': 'Jackson Xie', 'email': 'jackson.xie@mongodb.com'}

Message: SERVER-49796 use in-class member initialization for _reversePos
Branch: master
https://github.com/mongodb/mongo/commit/dd310a4a7df50368079b649367bedd520f9274ef

Comment by Henrik Edin [ 22/Jul/20 ]

It is harmless as _reversePos is initialized before it is ever being used. But it is good practice to initialize it in the constructor.

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