[SERVER-50196] Coverity analysis defect 116138: Uninitialized pointer field Created: 08/Aug/20  Updated: 29/Oct/23  Resolved: 19/Aug/20

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

Type: Bug Priority: Major - P3
Reporter: Coverity Collector User Assignee: Bernard Gorman
Resolution: Fixed Votes: 0
Labels: coverity, qexec-team
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Query 2020-08-24
Participants:

 Description   

Uninitialized pointer field

The pointer field will point to an arbitrary memory location, any attempt to write may cause corruption. A pointer field is not initialized in the constructor
/src/mongo/db/exec/multi_iterator.h:82: UNINIT_CTOR 116138 Class member declaration for "_opCtx".
/src/mongo/db/exec/multi_iterator.cpp:49: UNINIT_CTOR 116138 Non-static class member "_opCtx" is not initialized in this constructor nor in any functions that it calls.



 Comments   
Comment by Githook User [ 19/Aug/20 ]

Author:

{'name': 'Bernard Gorman', 'email': 'bernard.gorman@gmail.com', 'username': 'gormanb'}

Message: SERVER-50196 Remove redundant _opCtx member in MultiIteratorStage
Branch: master
https://github.com/mongodb/mongo/commit/114461404a6a252ed73e22f4b1585a6a3c714683

Comment by Bernard Gorman [ 15/Aug/20 ]

Yep, looks like it's pointlessly shadowing PlanStage::_opCtx. I'll get rid of it.

Comment by David Storch [ 14/Aug/20 ]

It looks to me like the MultiIteratorStage::_opCtx member variable should simply be deleted.

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