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

Coverity analysis defect 104941: Pointer to local outside scope

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.1.2
    • Component/s: Replication
    • Labels:
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Sprint:
      Repl 2018-08-13

      Description

      Pointer to a local stack variable returned or used outside scope

      Defect 104941 (STATIC_C)
      Checker RETURN_LOCAL (subcategory none)
      File: /src/mongo/db/repl/topology_coordinator.cpp
      Function _ZN5mongo4repl19TopologyCoordinator23_getReplSetStatusStringB5cxx11Ev
      /src/mongo/db/repl/topology_coordinator.cpp, line: 1378
      Assigning: "rsStatusArgs.initialSyncStatus" = "mongo::BSONObj()" (address of temporary variable of type "mongo::BSONObj").

              ReplSetStatusArgs rsStatusArgs{Date_t::now(), 0U, OpTime(), BSONObj(), boost::none};

      /src/mongo/db/repl/topology_coordinator.cpp, line: 1378
      Temporary variable of type "mongo::BSONObj" goes out of scope.

              ReplSetStatusArgs rsStatusArgs{Date_t::now(), 0U, OpTime(), BSONObj(), boost::none};

      File: /src/mongo/db/repl/topology_coordinator.cpp
      Function _ZN5mongo4repl19TopologyCoordinator23_getReplSetStatusStringB5cxx11Ev
      /src/mongo/db/repl/topology_coordinator.cpp, line: 1378
      Assigning: "rsStatusArgs.readConcernMajorityOpTime" = "mongo::repl::OpTime()" (address of temporary variable of type "mongo::repl::OpTime").

              ReplSetStatusArgs rsStatusArgs{Date_t::now(), 0U, OpTime(), BSONObj(), boost::none};

      /src/mongo/db/repl/topology_coordinator.cpp, line: 1378
      Temporary variable of type "mongo::repl::OpTime" goes out of scope.

              ReplSetStatusArgs rsStatusArgs{Date_t::now(), 0U, OpTime(), BSONObj(), boost::none};

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: