[SERVER-50836] Coverity analysis defect 115738: Uninitialized pointer field Created: 09/Sep/20  Updated: 29/Oct/23  Resolved: 17/Sep/20

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

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

Issue Links:
Related
is related to SERVER-49363 Triage Coverity Issues for Query code... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Query 2020-09-21
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/sbe/stages/text_match.h:86: UNINIT_CTOR 115738 Class member declaration for "_inValueAccessor".
/src/mongo/db/exec/sbe/stages/text_match.h:57: UNINIT_CTOR 115738 Non-static class member "_inValueAccessor" is not initialized in this constructor nor in any functions that it calls.



 Comments   
Comment by Githook User [ 17/Sep/20 ]

Author:

{'name': 'David Storch', 'email': 'david.storch@mongodb.com', 'username': 'dstorch'}

Message: SERVER-50836 Initialize TextMatchStage::_inValueAccessor to nullptr
Branch: master
https://github.com/mongodb/mongo/commit/abfa2bf309a46681177efa807b3f8a3165e41998

Comment by James Wahlin [ 09/Sep/20 ]

This is likely benign given the requirement to call prepare() prior to getNext(), but maybe still worth doing the work to initialize _inValueAccessor on construction.

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