diff options
author | Billy Donahue <billy.donahue@mongodb.com> | 2020-05-11 18:33:32 -0400 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-05-13 19:51:51 +0000 |
commit | a585cd2b6655af2542cdd153c4e9852d270b497d (patch) | |
tree | bc313fb3d24b5b45973195c4a8d140eea84a0499 /src/third_party | |
parent | ded0759bb5da3f9fd9373e0148e3861b319bffbe (diff) | |
download | mongo-a585cd2b6655af2542cdd153c4e9852d270b497d.tar.gz |
SERVER-48116 fix init-order bug in pcrecpp::RE::Init
(cherry picked from commit cb3f49285f8a5663244f94d89e56c2f28f7ae685)
Diffstat (limited to 'src/third_party')
-rw-r--r-- | src/third_party/pcre-8.42/patches/0002-SERVER-48116-fix-init-order-bug-in-pcrecpp-RE-Init.patch | 34 | ||||
-rw-r--r-- | src/third_party/pcre-8.42/pcrecpp.cc | 4 |
2 files changed, 35 insertions, 3 deletions
diff --git a/src/third_party/pcre-8.42/patches/0002-SERVER-48116-fix-init-order-bug-in-pcrecpp-RE-Init.patch b/src/third_party/pcre-8.42/patches/0002-SERVER-48116-fix-init-order-bug-in-pcrecpp-RE-Init.patch new file mode 100644 index 00000000000..66aab751b79 --- /dev/null +++ b/src/third_party/pcre-8.42/patches/0002-SERVER-48116-fix-init-order-bug-in-pcrecpp-RE-Init.patch @@ -0,0 +1,34 @@ +From 62877f15fcaf81eed85da5a7f11363d103a0b940 Mon Sep 17 00:00:00 2001 +From: Billy Donahue <billy.donahue@mongodb.com> +Date: Mon, 11 May 2020 18:33:32 -0400 +Subject: [PATCH] SERVER-48116 fix init-order bug in pcrecpp::RE::Init + +--- + src/third_party/pcre-8.42/pcrecpp.cc | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +diff --git a/src/third_party/pcre-8.42/pcrecpp.cc b/src/third_party/pcre-8.42/pcrecpp.cc +index 1147d01108..f37e3ed7c4 100644 +--- a/src/third_party/pcre-8.42/pcrecpp.cc ++++ b/src/third_party/pcre-8.42/pcrecpp.cc +@@ -77,9 +77,6 @@ extern Arg no_arg + // If a regular expression has no error, its error_ field points here + static const string empty_string; + +-// If the user doesn't ask for any options, we just use this one +-static RE_Options default_options; +- + // Specials for the start of patterns. See comments where start_options is used + // below. (PH June 2018) + static const char *start_options[] = { +@@ -102,6 +99,7 @@ static const char *start_options[] = { + void RE::Init(const string& pat, const RE_Options* options) { + pattern_ = pat; + if (options == NULL) { ++ static const RE_Options& default_options = *new RE_Options(); + options_ = default_options; + } else { + options_ = *options; +-- +2.17.1 + diff --git a/src/third_party/pcre-8.42/pcrecpp.cc b/src/third_party/pcre-8.42/pcrecpp.cc index 1147d01108a..f37e3ed7c44 100644 --- a/src/third_party/pcre-8.42/pcrecpp.cc +++ b/src/third_party/pcre-8.42/pcrecpp.cc @@ -77,9 +77,6 @@ extern Arg no_arg // If a regular expression has no error, its error_ field points here static const string empty_string; -// If the user doesn't ask for any options, we just use this one -static RE_Options default_options; - // Specials for the start of patterns. See comments where start_options is used // below. (PH June 2018) static const char *start_options[] = { @@ -102,6 +99,7 @@ static const char *start_options[] = { void RE::Init(const string& pat, const RE_Options* options) { pattern_ = pat; if (options == NULL) { + static const RE_Options& default_options = *new RE_Options(); options_ = default_options; } else { options_ = *options; |