[SERVER-62167] Coverity analysis defect 121257: Uninitialized scalar field Created: 17/Dec/21 Updated: 29/Oct/23 Resolved: 13/Jan/22 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 5.3.0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Coverity Collector User | Assignee: | Christopher Caplinger |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | coverity, neweng | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
| Backwards Compatibility: | Fully Compatible |
| Operating System: | ALL |
| Sprint: | Server Serverless 2022-01-24 |
| Participants: |
| Description |
|
Uninitialized scalar field The field will contain an arbitrary value left over from earlier computations. A scalar field is not initialized by the constructor |
| Comments |
| Comment by Githook User [ 12/Jan/22 ] |
|
Author: {'name': 'Christopher Caplinger', 'email': 'christopher.caplinger@mongodb.com', 'username': 'UnicodeSnowman'}Message: |
| Comment by Kyle Suarez [ 17/Dec/21 ] |
|
_backupCursorId is declared here without an initializer, and the default constructor does not set a value. CursorId is simply a long long so this field would end up being uninitialized. I'd recommend explicitly setting this to zero, since it seems we use zero as a sentinel value elsewhere to indicate the backup cursor is killed or unset. |