diff options
author | Gregory Noma <gregory.noma@gmail.com> | 2021-09-21 13:25:04 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-09-21 14:05:27 +0000 |
commit | bfef41e47abf95ec8f8114552d44df6c58409c9c (patch) | |
tree | 99d304018b0bb5859757c06887fb74faeb320343 /src/mongo | |
parent | df5e08c9823b7f984592356423cb50cdf3f20699 (diff) | |
download | mongo-bfef41e47abf95ec8f8114552d44df6c58409c9c.tar.gz |
SERVER-58552 Raise `kBSONDepthParameterFloor` to 21
Diffstat (limited to 'src/mongo')
-rw-r--r-- | src/mongo/bson/bson_depth.h | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/mongo/bson/bson_depth.h b/src/mongo/bson/bson_depth.h index e7e6836a8bf..ee0c7a2f235 100644 --- a/src/mongo/bson/bson_depth.h +++ b/src/mongo/bson/bson_depth.h @@ -39,16 +39,17 @@ struct BSONDepth { // The default BSON depth nesting limit. static constexpr std::int32_t kDefaultMaxAllowableDepth = 200; - // The minimum allowable value for the BSON depth parameter. - static constexpr std::int32_t kBSONDepthParameterFloor = 5; - - // The maximum allowable value for the BSON depth parameter. - static constexpr std::int32_t kBSONDepthParameterCeiling = 250; - // The number of extra levels of nesting above the storage depth limit that the server will // tolerate. static constexpr std::uint32_t kExtraSystemDepthLevels = 20; + // The minimum allowable value for the BSON depth parameter. Choose a value such that the max + // depth for user storage will be at least 1. + static constexpr std::int32_t kBSONDepthParameterFloor = kExtraSystemDepthLevels + 1; + + // The maximum allowable value for the BSON depth parameter. + static constexpr std::int32_t kBSONDepthParameterCeiling = 250; + // The depth of BSON accepted by the server. Configurable via the 'maxBSONDepth' server // parameter. static std::int32_t maxAllowableDepth; |