Skip to content

Commit 6b748b2

Browse files
dwighterh
authored andcommitted
validate skip() value on a query
1 parent e316c78 commit 6b748b2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

db/query.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1121,7 +1121,9 @@ namespace mongo {
11211121
saveClientCursor_(),
11221122
findingStart_( (queryOptions & Option_OplogReplay) != 0 ),
11231123
findingStartCursor_()
1124-
{}
1124+
{
1125+
uassert("bad skip value in query", ntoskip >= 0);
1126+
}
11251127

11261128
virtual void init() {
11271129
b_.skip( sizeof( QueryResult ) );

0 commit comments

Comments
 (0)