summaryrefslogtreecommitdiff
path: root/src/mongo/db/pipeline
diff options
context:
space:
mode:
authorArun Banala <arun.banala@mongodb.com>2019-03-20 23:23:58 +0000
committerArun Banala <arun.banala@mongodb.com>2019-03-20 23:32:59 +0000
commit8af009307fa1f5f51e839ac45921f64a11e1b2dd (patch)
treeb36aa18b736fd667a2ff95175eda6f591ac48eb2 /src/mongo/db/pipeline
parentf8f198e55172ba49d9ffb94be50d4e900caa1108 (diff)
downloadmongo-8af009307fa1f5f51e839ac45921f64a11e1b2dd.tar.gz
SERVER-39694 Fix undefined behaviour with string.front() when empty
Diffstat (limited to 'src/mongo/db/pipeline')
-rw-r--r--src/mongo/db/pipeline/expression.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mongo/db/pipeline/expression.cpp b/src/mongo/db/pipeline/expression.cpp
index 629bfd847f8..6d6be9362b0 100644
--- a/src/mongo/db/pipeline/expression.cpp
+++ b/src/mongo/db/pipeline/expression.cpp
@@ -5677,7 +5677,7 @@ public:
int execute(int startBytePos) {
int execResult = pcre_exec(_pcre,
0,
- &_input.front(),
+ _input.c_str(),
_input.size(),
startBytePos,
0, // No need to overwrite the options set during pcre_compile.