[SERVER-63603] Coverity analysis defect 121548: Pointer to local outside scope Created: 13/Feb/22  Updated: 27/Oct/23  Resolved: 25/Feb/22

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

Type: Bug Priority: Major - P3
Reporter: Coverity Collector User Assignee: Nikita Lapkov (Inactive)
Resolution: Gone away Votes: 0
Labels: coverity
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Operating System: ALL
Sprint: QO 2022-03-07
Participants:

 Description   

Pointer to local outside scope

Dereferencing the returned or out-of-scope stack pointer will access an invalid location on the stack after its scope or after the function returns. Pointer to a local stack variable returned or used outside scope
/src/mongo/db/query/planner_analysis.cpp:634: RETURN_LOCAL 121548 Assigning: "prefixedIndex" = "&idxEntry" (address of local variable "idxEntry").
/src/mongo/db/query/planner_analysis.cpp:635: RETURN_LOCAL 121548 Variable "idxEntry" goes out of scope.
/src/mongo/db/query/planner_analysis.cpp:643: RETURN_LOCAL 121548 Using "prefixedIndex", which points to an out-of-scope variable "idxEntry".



 Comments   
Comment by Nikita Lapkov (Inactive) [ 25/Feb/22 ]

Confirmed, this code is no longer in master.

Comment by James Wahlin [ 23/Feb/22 ]

It looks like this may have gone away as part of nikita.lapkov's commit for SERVER-63570. Sending to QE to confirm and to double check that this code was fixed rather than moved elsewhere.

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