summaryrefslogtreecommitdiff
path: root/src/mongo/bson/bsonelement.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/bson/bsonelement.h')
-rw-r--r--src/mongo/bson/bsonelement.h15
1 files changed, 3 insertions, 12 deletions
diff --git a/src/mongo/bson/bsonelement.h b/src/mongo/bson/bsonelement.h
index d7733b7966a..892be6df831 100644
--- a/src/mongo/bson/bsonelement.h
+++ b/src/mongo/bson/bsonelement.h
@@ -494,18 +494,9 @@ public:
if (binDataType() != ByteArrayDeprecated) {
return binData(len);
} else {
- // Because, for some time, the shell has incorrectly created type 2 binary objects
- // without the extra length, we try to identify if this object does or doesn't start
- // with a length and skip past it when its present. See SERVER-41994
- if (valuestrsize() >= 4 &&
- ConstDataView(value() + 5).read<LittleEndian<int>>() == valuestrsize() - 4) {
- // Skip extra size
- len = valuestrsize() - 4;
- return value() + 5 + 4;
- } else {
- len = valuestrsize();
- return value() + 5;
- }
+ // Skip extra size
+ len = valuestrsize() - 4;
+ return value() + 5 + 4;
}
}