Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-37160

Coverity analysis defect 105017: Dereference null return value

    • ALL
    • Sharding 2018-10-22, Sharding 2018-11-05

      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);
      

            Assignee:
            matthew.saltz@mongodb.com Matthew Saltz (Inactive)
            Reporter:
            xgen-internal-coverity Coverity Collector User
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: