[SERVER-55210] Risk stack-use-after-scope error when getting const reference of value held in optional Created: 15/Mar/21 Updated: 29/Oct/23 Resolved: 16/Mar/21 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 4.9.0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Lingzhi Deng | Assignee: | Lingzhi Deng |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | pm-1791_other_required | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||
| Backwards Compatibility: | Fully Compatible | ||||
| Operating System: | ALL | ||||
| Sprint: | Repl 2021-03-22 | ||||
| Participants: | |||||
| Linked BF Score: | 185 | ||||
| Description |
|
This is the block of code that's problematic. getTxnNumber() and getStatementId() return by value and the operator* gets in the way so that the lifetime of the temporary optional is not extended. |
| Comments |
| Comment by Githook User [ 15/Mar/21 ] |
|
Author: {'name': 'Lingzhi Deng', 'email': 'lingzhi.deng@mongodb.com', 'username': 'ldennis'}Message: |