[SERVER-65890] Coverity analysis defect 122131: Dereference after null check Created: 22/Apr/22  Updated: 29/Oct/23  Resolved: 16/Jun/22

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

Type: Bug Priority: Major - P3
Reporter: Coverity Collector User Assignee: Jordi Olivares Provencio
Resolution: Fixed Votes: 0
Labels: coverity
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File Screen Shot 2022-04-22 at 8.57.00 AM.png    
Issue Links:
Problem/Incident
is caused by SERVER-63825 Report metrics for read/write queues Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Execution Team 2022-06-27
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
/src/mongo/db/concurrency/lock_state.cpp:375: FORWARD_NULL 122131 Comparing "opCtx" to null implies that "opCtx" might be null.



 Comments   
Comment by Githook User [ 16/Jun/22 ]

Author:

{'name': 'Jordi Olivares Provencio', 'email': 'jordi.olivares-provencio@mongodb.com', 'username': 'jordiolivares'}

Message: SERVER-65890 Remove unnecessary null check in LockerImpl
Branch: master
https://github.com/mongodb/mongo/commit/e2b75378f0460e1cceec4dcb2120d104cdc24ece

Generated at Thu Feb 08 06:03:55 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.