Skip to content

Commit 239d7d6

Browse files
author
Dan Pasette
committed
SERVER-6647 Potential out of bounds access in ReplicaSetMonitor
Backport of commit f86f60a
1 parent 5eaf375 commit 239d7d6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

client/dbclient_rs.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -625,7 +625,10 @@ namespace mongo {
625625
{
626626
scoped_lock lk( _lock );
627627
probablePrimaryIdx = _find_inlock( maybePrimary );
628-
probablePrimaryConn = _nodes[probablePrimaryIdx].conn;
628+
629+
if (probablePrimaryIdx >= 0) {
630+
probablePrimaryConn = _nodes[probablePrimaryIdx].conn;
631+
}
629632
}
630633

631634
if ( probablePrimaryIdx >= 0 ) {

0 commit comments

Comments
 (0)