summaryrefslogtreecommitdiff
path: root/src/mongo/client
diff options
context:
space:
mode:
authorzhaoliwei <zhaoliwei@xiaomi.com>2020-03-25 13:55:25 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-04-02 17:40:39 +0000
commitb1edffdf299ebca77f3f8eeb621ed49ce0810917 (patch)
treebbcd043a7dd99c387802e0a2c34b7c4768ac58ab /src/mongo/client
parentcf571d9224eff2b613756af87fb0e2974192138a (diff)
downloadmongo-b1edffdf299ebca77f3f8eeb621ed49ce0810917.tar.gz
SERVER-45063 fix the bug in mongo::uriDecode
Closes #1340 Signed-off-by: Henrik Edin <henrik.edin@mongodb.com>
Diffstat (limited to 'src/mongo/client')
-rw-r--r--src/mongo/client/mongo_uri.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mongo/client/mongo_uri.cpp b/src/mongo/client/mongo_uri.cpp
index 73c8ed8de76..de4f87ff2f5 100644
--- a/src/mongo/client/mongo_uri.cpp
+++ b/src/mongo/client/mongo_uri.cpp
@@ -89,7 +89,7 @@ mongo::StatusWith<std::string> mongo::uriDecode(StringData toDecode) {
for (size_t i = 0; i < toDecode.size(); ++i) {
const char c = toDecode[i];
if (c == '%') {
- if (i + 2 > toDecode.size()) {
+ if (i + 2 >= toDecode.size()) {
return Status(ErrorCodes::FailedToParse,
"Encountered partial escape sequence at end of string");
}