[SERVER-77384] Coverity analysis defect 138136: Dereference after null check Created: 22/May/23 Updated: 29/Oct/23 Resolved: 10/Aug/23 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Internal Code |
| Affects Version/s: | None |
| Fix Version/s: | 7.1.0-rc0 |
| Type: | Improvement | Priority: | Minor - P4 |
| Reporter: | Coverity Collector User | Assignee: | Maya Srikanth (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | coverity, neweng | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Assigned Teams: |
Query Optimization
|
| Backwards Compatibility: | Fully Compatible |
| Participants: |
| Description |
|
Dereference after null check Either the check against null is unnecessary, or there may be a null pointer dereference. Pointer is checked against null but then dereferenced anyway |
| Comments |
| Comment by Githook User [ 10/Aug/23 ] |
|
Author: {'name': 'Maya Srikanth', 'email': 'maya.srikanth@mongodb.com', 'username': ''}Message: |
| Comment by Kyle Suarez [ 23/May/23 ] |
|
I'm marking this as an "Improvement" and not a "Bug" because IIRC, the OperationContext should actually be set here and not null. If that is truly the case we should just assert as such and then not treat like the opCtx could be nullish. (I felt like I had a conversation about this with someone recently, but I cannot remember.) |