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

Coverity analysis defect 72719: Dereference null return value

    • Fully Compatible
    • ALL
    • Sharding 5 06/26/16

      Return value of function which returns null is dereferenced without checking

      Defect 72719 (STATIC_C)
      Checker NULL_RETURNS (subcategory none)
      File: /src/mongo/client/replica_set_monitor_read_preference_test.cpp
      Function <unnamed>::selectNode(const std::vector<mongo::ReplicaSetMonitor::SetState::Node, std::allocator<mongo::ReplicaSetMonitor::SetState::Node>> &, mongo::ReadPreference, const mongo::TagSet &, int, bool *)
      /src/mongo/client/replica_set_monitor_read_preference_test.cpp, line: 67
      Dereferencing a null pointer "set.findNode(out)".

                      *isPrimarySelected = !out.empty() && set.findNode(out)->isMaster;
      

            Assignee:
            daniel.alabi@10gen.com Daniel Alabi
            Reporter:
            xgen-internal-coverity Coverity Collector User
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: