Details
-
Bug
-
Resolution: Done
-
Major - P3
-
3.0.5, 3.1.6
-
None
-
Server Tools A (10/09/15)
-
v3.0
Description
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
|
Attachments
Issue Links
- is duplicated by
-
TOOLS-942 mongorestore panic error
-
- Closed
-