[SERVER-45207] Address of stack memory associated with local variable 'replOperation' returned to caller Created: 17/Dec/19  Updated: 29/Oct/23  Resolved: 11/Mar/20

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: None
Fix Version/s: 4.4.0-rc0, 4.7.0

Type: Bug Priority: Major - P3
Reporter: Matthew Saltz (Inactive) Assignee: Alexander Taskov (Inactive)
Resolution: Fixed Votes: 0
Labels: sharding-4.4-stabilization, sharding-wfbf-day
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v4.4
Sprint: Sharding 2020-03-23
Participants:

 Description   

I run clang-tidy locally in vim and it caught that in this function we take an input parameter by copy and then return a reference to its memory (which is bad because the temporary object will be destroyed when it goes out of scope.

We should fix this.



 Comments   
Comment by Githook User [ 16/Mar/20 ]

Author:

{'name': 'Alex Taskov', 'username': 'alextaskov', 'email': 'alex.taskov@mongodb.com'}

Message: SERVER-45207 Address of stack memory associated with local variable 'replOperation' returned to caller

(cherry picked from commit ea86f6a717036652450fab61aa6a60bb7d3f7dd3)
Branch: v4.4
https://github.com/mongodb/mongo/commit/98f9954e92d0fe48318eafd631bf203584d6b303

Comment by Githook User [ 11/Mar/20 ]

Author:

{'name': 'Alex Taskov', 'username': 'alextaskov', 'email': 'alex.taskov@mongodb.com'}

Message: SERVER-45207 Address of stack memory associated with local variable 'replOperation' returned to caller
Branch: master
https://github.com/mongodb/mongo/commit/ea86f6a717036652450fab61aa6a60bb7d3f7dd3

Comment by Ratika Gandhi [ 20/Dec/19 ]

acm, we'll file a separate ticket to turn on additional clang tidy checks.

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