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

Coverity analysis defect 104941: Pointer to local outside scope

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.1.2
    • Affects Version/s: None
    • Component/s: Replication
    • Fully Compatible
    • ALL
    • Repl 2018-08-13

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

            Assignee:
            tess.avitabile@mongodb.com Tess Avitabile (Inactive)
            Reporter:
            xgen-internal-coverity Coverity Collector User
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: