diff options
author | matt dannenberg <matt.dannenberg@10gen.com> | 2015-11-13 05:52:16 -0500 |
---|---|---|
committer | matt dannenberg <matt.dannenberg@10gen.com> | 2015-11-13 08:27:31 -0500 |
commit | 5980c09739ad203916a4604ee8533ea5aacf58e9 (patch) | |
tree | 3e498ba8d2765e1d5258f38c9aba1a696845e467 /src/mongo/db/repl/replica_set_config.cpp | |
parent | 9e431f4fd9a6af65292aff3729a3f6d281784ac1 (diff) | |
download | mongo-5980c09739ad203916a4604ee8533ea5aacf58e9.tar.gz |
SERVER-21447 reject configs with protocolversions other than 0 and 1
Diffstat (limited to 'src/mongo/db/repl/replica_set_config.cpp')
-rw-r--r-- | src/mongo/db/repl/replica_set_config.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mongo/db/repl/replica_set_config.cpp b/src/mongo/db/repl/replica_set_config.cpp index 106e8329473..2e83b80a000 100644 --- a/src/mongo/db/repl/replica_set_config.cpp +++ b/src/mongo/db/repl/replica_set_config.cpp @@ -422,10 +422,10 @@ Status ReplicaSetConfig::validate() const { } } - if (_protocolVersion < 0 || _protocolVersion > std::numeric_limits<int>::max()) { + if (_protocolVersion != 0 && _protocolVersion != 1) { return Status(ErrorCodes::BadValue, str::stream() << kProtocolVersionFieldName << " field value of " - << _protocolVersion << " is out of range"); + << _protocolVersion << " is not 1 or 0"); } if (_configServer) { |