diff options
author | James Wahlin <james@mongodb.com> | 2017-10-23 09:25:17 -0400 |
---|---|---|
committer | James Wahlin <james@mongodb.com> | 2017-10-30 08:26:22 -0400 |
commit | 9becaec05921e0fd6eeb3e7bdf8c91ca1f6531c7 (patch) | |
tree | a5b3a2fd9c52eff5ff5bbc82f6801acbafdd9e08 /src/mongo/db/query/datetime | |
parent | db64381873afebf1532a0fd576499f72da00b703 (diff) | |
download | mongo-9becaec05921e0fd6eeb3e7bdf8c91ca1f6531c7.tar.gz |
SERVER-31664 Fix use after free of OperationContext by ExpressionDate*
Addresses the case where a time zone expression lives within a collection
validator as part of a $expr expression. In this case, the Expression
will outlive the OperationContext it was created under.
Diffstat (limited to 'src/mongo/db/query/datetime')
-rw-r--r-- | src/mongo/db/query/datetime/date_time_support.cpp | 1 | ||||
-rw-r--r-- | src/mongo/db/query/datetime/date_time_support.h | 3 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/mongo/db/query/datetime/date_time_support.cpp b/src/mongo/db/query/datetime/date_time_support.cpp index fc24dd22206..2b6cb8ec078 100644 --- a/src/mongo/db/query/datetime/date_time_support.cpp +++ b/src/mongo/db/query/datetime/date_time_support.cpp @@ -68,7 +68,6 @@ long long seconds(Date_t date) { } // namespace const TimeZoneDatabase* TimeZoneDatabase::get(ServiceContext* serviceContext) { - invariant(getTimeZoneDatabase(serviceContext)); return getTimeZoneDatabase(serviceContext).get(); } diff --git a/src/mongo/db/query/datetime/date_time_support.h b/src/mongo/db/query/datetime/date_time_support.h index 9973a198939..9d5b3188abc 100644 --- a/src/mongo/db/query/datetime/date_time_support.h +++ b/src/mongo/db/query/datetime/date_time_support.h @@ -346,7 +346,8 @@ public: }; /** - * Returns the TimeZoneDatabase object associated with the specified service context. + * Returns the TimeZoneDatabase object associated with the specified service context or nullptr + * if none exists. */ static const TimeZoneDatabase* get(ServiceContext* serviceContext); |