summaryrefslogtreecommitdiff
path: root/src/mongo/bson/bsonobjbuilder.h
diff options
context:
space:
mode:
authorMathias Stearn <mathias@10gen.com>2017-03-31 14:43:28 -0400
committerMathias Stearn <mathias@10gen.com>2017-04-12 08:57:12 -0400
commite502d0256ec27fdc645c7ae28d2c3ef7eab364db (patch)
tree18624612ed1f19e5c135a208108986bb2d011b19 /src/mongo/bson/bsonobjbuilder.h
parent4cefd9e258b71ad13a1b992f24c96417e588c45f (diff)
downloadmongo-e502d0256ec27fdc645c7ae28d2c3ef7eab364db.tar.gz
SERVER-28508 Tighten invariant in BSONObjBuilder resume constructor
Diffstat (limited to 'src/mongo/bson/bsonobjbuilder.h')
-rw-r--r--src/mongo/bson/bsonobjbuilder.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mongo/bson/bsonobjbuilder.h b/src/mongo/bson/bsonobjbuilder.h
index 835fe4e8312..4840a0f7210 100644
--- a/src/mongo/bson/bsonobjbuilder.h
+++ b/src/mongo/bson/bsonobjbuilder.h
@@ -104,7 +104,7 @@ public:
_s(this),
_tracker(nullptr),
_doneCalled(false) {
- invariant(_b.len() >= BSONObj::kMinBSONLength);
+ invariant(_b.len() - offset >= BSONObj::kMinBSONLength);
_b.setlen(_b.len() - 1); // get rid of the previous EOO.
// Reserve space for our EOO.
_b.reserveBytes(1);