-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: 3.0.5, 3.1.6
-
Component/s: bsondump, mongorestore
-
None
-
Server Tools A (10/09/15)
-
v3.0
The code for decoding a BSON stream does not properly catch all invalid sizes. We check that a document size isn't > 16MB, but not that it isn't less than 5. So when we have an invalid bson document with size < 5, and we hit the line
_, err = io.ReadAtLeast(bs.Stream, into[4:int(bsonSize)], int(bsonSize-4))
we get a
panic: runtime error: slice bounds out of range
- is duplicated by
-
TOOLS-942 mongorestore panic error
- Closed