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

Potential out of bounds access in ReplicaSetMonitor

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

      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@mongodb.com Randolph Tan
            Reporter:
            randolph@mongodb.com Randolph Tan
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: