summaryrefslogtreecommitdiff
path: root/src/mongo/db/commands.cpp
diff options
context:
space:
mode:
authorCheahuychou Mao <cheahuychou.mao@mongodb.com>2020-02-07 16:49:09 -0500
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-02-10 20:24:37 +0000
commit03afebeb32be04bc92ec205369922f318fc05a30 (patch)
treeb10c24ac854c9ccbcf9b970d83f6df7dd48b8077 /src/mongo/db/commands.cpp
parent0be749a16f4523b2a23729e0754a89ba5ea99644 (diff)
downloadmongo-03afebeb32be04bc92ec205369922f318fc05a30.tar.gz
SERVER-46045 Return false in shouldActivateFailCommandFailPoint if the command does not have a valid namespace
Diffstat (limited to 'src/mongo/db/commands.cpp')
-rw-r--r--src/mongo/db/commands.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/mongo/db/commands.cpp b/src/mongo/db/commands.cpp
index e5707b01d37..9f7fb5991b3 100644
--- a/src/mongo/db/commands.cpp
+++ b/src/mongo/db/commands.cpp
@@ -503,7 +503,13 @@ bool CommandHelpers::shouldActivateFailCommandFailPoint(const BSONObj& data,
const CommandInvocation* invocation,
Client* client) {
const Command* cmd = invocation->definition();
- const NamespaceString& nss = invocation->ns();
+ NamespaceString nss;
+ try {
+ nss = invocation->ns();
+ } catch (const ExceptionFor<ErrorCodes::InvalidNamespace>&) {
+ return false;
+ }
+
if (cmd->getName() == "configureFailPoint"_sd) // Banned even if in failCommands.
return false;