[SERVER-37160] Coverity analysis defect 105017: Dereference null return value Created: 17/Sep/18  Updated: 23/Oct/18  Resolved: 23/Oct/18

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

Type: Bug Priority: Major - P3
Reporter: Coverity Collector User Assignee: Matthew Saltz (Inactive)
Resolution: Duplicate Votes: 0
Labels: Coverity, sharding-wfbf-day
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-37244 Implement checkOutSessionForKill API ... Closed
Operating System: ALL
Sprint: Sharding 2018-10-22, Sharding 2018-11-05
Participants:

 Description   

Return value of function which returns null is dereferenced without checking

Defect 105017 (STATIC_C)
Checker NULL_RETURNS (subcategory none)
File: /src/mongo/db/s/txn_two_phase_commit_cmds.cpp
Function mongo::<unnamed>::CoordinateCommitTransactionCmd::Invocation::typedRun(mongo::OperationContext *)
/src/mongo/db/s/txn_two_phase_commit_cmds.cpp, line: 269
Assigning: "txnParticipant" = null return value from "get".

                    auto txnParticipant = TransactionParticipant::get(opCtx);

File: /src/mongo/db/s/txn_two_phase_commit_cmds.cpp
Function mongo::<unnamed>::CoordinateCommitTransactionCmd::Invocation::typedRun(mongo::OperationContext *)
/src/mongo/db/s/txn_two_phase_commit_cmds.cpp, line: 269
Assigning: "txnParticipant" = null return value from "get".

                    auto txnParticipant = TransactionParticipant::get(opCtx);



 Comments   
Comment by Matthew Saltz (Inactive) [ 23/Oct/18 ]

This will no longer be an issue once all users of the TransactionParticipant have to check out the session first.

Generated at Thu Feb 08 04:45:09 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.