Potential out of bounds access in ReplicaSetMonitor

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Major - P3
    • 2.0.8, 2.2.0-rc1
    • Affects Version/s: 2.2.0-rc0
    • Component/s: Internal Client
    • None
    • ALL
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      massert( 15899, str::stream() << "No suitable secondary found for slaveOk query in replica set: "
               << _name, _master >= 0 && _nodes[_master].ok ); // <----------- _master can be out of bounds here
      
      // Fall back to primary
      verify( static_cast<unsigned>(_master) < _nodes.size() );
      

      and here (ReplicaSetMonitor::_check):

      probablePrimaryIdx = _find_inlock( maybePrimary );
      probablePrimaryConn = _nodes[probablePrimaryIdx].conn;
      

              Assignee:
              Randolph Tan
              Reporter:
              Randolph Tan
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: