summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Caplinger <christopher.caplinger@mongodb.com>2022-02-24 21:34:59 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-02-24 22:10:19 +0000
commite9dec3c50147c0a241e16235cc0c41dd127c4971 (patch)
tree26220f77be82cb2dfd670477d958787eaae3b627
parent2a5b59c4fd6d4182f81755ebd1ff755dd88db6e9 (diff)
downloadmongo-e9dec3c50147c0a241e16235cc0c41dd127c4971.tar.gz
SERVER-63831: Assert that filesize is non-negative
-rw-r--r--src/mongo/db/repl/tenant_migration_shard_merge_util.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mongo/db/repl/tenant_migration_shard_merge_util.cpp b/src/mongo/db/repl/tenant_migration_shard_merge_util.cpp
index 700e0d34916..2d9d7fa0025 100644
--- a/src/mongo/db/repl/tenant_migration_shard_merge_util.cpp
+++ b/src/mongo/db/repl/tenant_migration_shard_merge_util.cpp
@@ -255,7 +255,7 @@ void cloneFile(OperationContext* opCtx, const BSONObj& metadataDoc) {
"metadata"_attr = metadataDoc);
auto backupId = UUID(uassertStatusOK(UUID::parse(metadataDoc[kBackupIdFieldName])));
auto remoteDbpath = metadataDoc["remoteDbpath"].str();
- size_t fileSize = metadataDoc["fileSize"].safeNumberLong();
+ size_t fileSize = std::max(0ll, metadataDoc["fileSize"].safeNumberLong());
auto relativePath = _getPathRelativeTo(fileName, metadataDoc[kDonorDbPathFieldName].str());
invariant(!relativePath.empty());