[SERVER-50106] Coverity analysis defect 115639: Dereference after null check Created: 04/Aug/20  Updated: 29/Oct/23  Resolved: 25/Nov/20

Status: Closed
Project: Core Server
Component/s: Storage
Affects Version/s: None
Fix Version/s: 4.9.0

Type: Bug Priority: Major - P3
Reporter: Coverity Collector User Assignee: Gregory Noma
Resolution: Fixed Votes: 0
Labels: coverity, neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Execution Team 2020-11-30
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/modules/enterprise/src/hot_backups/backup_cursor_service.cpp:82: FORWARD_NULL 115639 Comparing "replCoord" to null implies that "replCoord" might be null.
/src/mongo/db/modules/enterprise/src/hot_backups/backup_cursor_service.cpp:115: FORWARD_NULL 115639 Passing null pointer "replCoord" to "getTerm", which dereferences it. (The dereference happens because this is a virtual function call.)



 Comments   
Comment by Githook User [ 25/Nov/20 ]

Author:

{'name': 'Gregory Noma', 'email': 'gregory.noma@gmail.com', 'username': 'gregorynoma'}

Message: SERVER-50106 Coverity analysis defect 115639: Dereference after null check
Branch: master
https://github.com/10gen/mongo-enterprise-modules/commit/70930a483029e54d43f4511662cc3010c9ea2c1e

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