When the driver is presented with corrupt BSON to encode, it should throw a BsonSerializationException. It should not successfully parse the BSON, and it should not throw other runtime exceptions.
Examples where this is not currently the case include:
- When the length of a BSON string is negative
- When a BSON string is not properly null-terminated
- When the buffer is not large enough to read the expected bytes (e.g., an Int32 is expected but there are < 4 bytes remaining)