summaryrefslogtreecommitdiff
path: root/src/mongo/db/pipeline
diff options
context:
space:
mode:
authorJames Wahlin <james@mongodb.com>2022-06-15 16:03:29 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-06-16 11:47:33 +0000
commitc5b3c193d802c5618db349af4efdadbca5e59125 (patch)
treec1f247255f3a11d5cdb9ae932a42b8c0c1f4af72 /src/mongo/db/pipeline
parentc4ba4a3e074bcf6e5c64cbedf90e92ba0e0353c2 (diff)
downloadmongo-c5b3c193d802c5618db349af4efdadbca5e59125.tar.gz
SERVER-67315 Fix possible int32 overflow on call to DocumentSourceSort::createBoundedSort()
Diffstat (limited to 'src/mongo/db/pipeline')
-rw-r--r--src/mongo/db/pipeline/pipeline_d.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mongo/db/pipeline/pipeline_d.cpp b/src/mongo/db/pipeline/pipeline_d.cpp
index 7bd2179d97d..1f64e7e0e82 100644
--- a/src/mongo/db/pipeline/pipeline_d.cpp
+++ b/src/mongo/db/pipeline/pipeline_d.cpp
@@ -1409,8 +1409,9 @@ PipelineD::buildInnerQueryExecutorGeneric(const MultipleCollectionAccessor& coll
sort->getSortKeyPattern(),
(indexOrderedByMinTime ? DocumentSourceSort::kMin
: DocumentSourceSort::kMax),
- ((indexOrderedByMinTime) ? unpack->getBucketMaxSpanSeconds()
- : -unpack->getBucketMaxSpanSeconds()) *
+ static_cast<long long>((indexOrderedByMinTime)
+ ? unpack->getBucketMaxSpanSeconds()
+ : -unpack->getBucketMaxSpanSeconds()) *
1000,
sort->getLimit(),
expCtx));