summaryrefslogtreecommitdiff
path: root/src/mongo/db/exec
diff options
context:
space:
mode:
authorDavid Storch <david.storch@10gen.com>2016-12-05 11:19:48 -0500
committerDavid Storch <david.storch@10gen.com>2016-12-09 17:59:52 -0500
commit7cf929f25638e4ad9525775c8ea0e18f3c86faf5 (patch)
tree42328072009a72ce73f1c5bffe60f0c36ee0d492 /src/mongo/db/exec
parent586ac20773ff7dc18cabf329c238bf261e00387d (diff)
downloadmongo-7cf929f25638e4ad9525775c8ea0e18f3c86faf5.tar.gz
SERVER-24128 reject embedded null bytes in namespace string parsing
Diffstat (limited to 'src/mongo/db/exec')
-rw-r--r--src/mongo/db/exec/group.cpp3
-rw-r--r--src/mongo/db/exec/group.h3
2 files changed, 3 insertions, 3 deletions
diff --git a/src/mongo/db/exec/group.cpp b/src/mongo/db/exec/group.cpp
index 5ec8226c431..37ce67ad9fc 100644
--- a/src/mongo/db/exec/group.cpp
+++ b/src/mongo/db/exec/group.cpp
@@ -96,9 +96,8 @@ Status GroupStage::initGroupScripting() {
const std::string userToken =
AuthorizationSession::get(Client::getCurrent())->getAuthenticatedUserNamesToken();
- const NamespaceString nss(_request.ns);
_scope = getGlobalScriptEngine()->getPooledScope(
- getOpCtx(), nss.db().toString(), "group" + userToken);
+ getOpCtx(), _request.ns.db().toString(), "group" + userToken);
if (!_request.reduceScope.isEmpty()) {
_scope->init(&_request.reduceScope);
}
diff --git a/src/mongo/db/exec/group.h b/src/mongo/db/exec/group.h
index 7ec5efe647f..95b8a788a1d 100644
--- a/src/mongo/db/exec/group.h
+++ b/src/mongo/db/exec/group.h
@@ -30,6 +30,7 @@
#include "mongo/bson/simple_bsonobj_comparator.h"
#include "mongo/db/exec/plan_stage.h"
+#include "mongo/db/namespace_string.h"
#include "mongo/scripting/engine.h"
namespace mongo {
@@ -41,7 +42,7 @@ class Collection;
*/
struct GroupRequest {
// Namespace to operate on (e.g. "foo.bar").
- std::string ns;
+ NamespaceString ns;
// A predicate describing the set of documents to group.
BSONObj query;