summaryrefslogtreecommitdiff
path: root/src/mongo/db/instance.cpp
diff options
context:
space:
mode:
authorDavid Storch <david.storch@10gen.com>2016-01-19 15:03:06 -0500
committerDavid Storch <david.storch@10gen.com>2016-01-21 15:11:38 -0500
commitabafc33866c53f6339e2f30f11077a692d64c709 (patch)
tree06eefb31d37e47b5124f1db8f9dda97967351ff8 /src/mongo/db/instance.cpp
parentee050e4700001d0f9ebf8aa388c57307ff405574 (diff)
downloadmongo-abafc33866c53f6339e2f30f11077a692d64c709.tar.gz
SERVER-20808 reject negative ntoreturn on OP_GET_MORE messages
Also makes negative ntoreturn an error on a tailable cursor, which was previously the only known edge case in which the shell could send a negative ntoreturn with a getMore.
Diffstat (limited to 'src/mongo/db/instance.cpp')
-rw-r--r--src/mongo/db/instance.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/mongo/db/instance.cpp b/src/mongo/db/instance.cpp
index e1cd9230d24..921f507ab00 100644
--- a/src/mongo/db/instance.cpp
+++ b/src/mongo/db/instance.cpp
@@ -878,6 +878,8 @@ bool receivedGetMore(OperationContext* txn, DbResponse& dbresponse, Message& m,
const char* ns = d.getns();
int ntoreturn = d.pullInt();
+ uassert(
+ 34368, str::stream() << "Invalid ntoreturn for OP_GET_MORE: " << ntoreturn, ntoreturn >= 0);
long long cursorid = d.pullInt64();
curop.debug().ntoreturn = ntoreturn;