diff options
author | Benety Goh <benety@mongodb.com> | 2021-05-25 19:52:46 -0400 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-05-26 00:14:17 +0000 |
commit | 8e370ecd5f94b6c287084783c0ebe8c175a6993f (patch) | |
tree | 95c7485aaa3790e5a3efcabbf6fe832999568675 /src/mongo/db | |
parent | 9d31696a31388af10b3351ac6f67ad1765d1d48c (diff) | |
download | mongo-8e370ecd5f94b6c287084783c0ebe8c175a6993f.tar.gz |
SERVER-57097 fix FTSSpec::fixSpec() to handle int values in weight values that are out of bounds
Diffstat (limited to 'src/mongo/db')
-rw-r--r-- | src/mongo/db/fts/fts_spec.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mongo/db/fts/fts_spec.cpp b/src/mongo/db/fts/fts_spec.cpp index f54bef71f4e..7226ff5bb44 100644 --- a/src/mongo/db/fts/fts_spec.cpp +++ b/src/mongo/db/fts/fts_spec.cpp @@ -385,7 +385,7 @@ StatusWith<BSONObj> FTSSpec::fixSpec(const BSONObj& spec) { if (!e.isNumber()) { return {ErrorCodes::CannotCreateIndex, "weight for text index needs numeric type"}; } - m[e.fieldName()] = e.numberInt(); + m[e.fieldName()] = e.safeNumberInt(); } } else if (spec["weights"].str() == WILDCARD) { m[WILDCARD] = 1; |