From 9f8dc3af1762f9de35324e98248f1b5a049ca17d Mon Sep 17 00:00:00 2001 From: David Storch Date: Fri, 14 Aug 2015 10:07:49 -0400 Subject: [PATCH] SERVER-19951 do not read unitialized variable in find command --- src/mongo/db/commands/find_cmd.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mongo/db/commands/find_cmd.cpp b/src/mongo/db/commands/find_cmd.cpp index 3b544e78be797..4ed68b7f1222f 100644 --- a/src/mongo/db/commands/find_cmd.cpp +++ b/src/mongo/db/commands/find_cmd.cpp @@ -311,7 +311,7 @@ class FindCmd : public Command { // 5) Stream query results, adding them to a BSONArray as we go. BSONArrayBuilder firstBatch; BSONObj obj; - PlanExecutor::ExecState state; + PlanExecutor::ExecState state = PlanExecutor::ADVANCED; long long numResults = 0; while (!FindCommon::enoughForFirstBatch(pq, numResults, firstBatch.len()) && PlanExecutor::ADVANCED == (state = cursorExec->getNext(&obj, NULL))) {