Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-1864

Driver should throw BsonSerializationException when corrupt BSON is encountered

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 3.1.0
    • Affects Version/s: 3.0.2
    • Component/s: BSON
    • Labels:
      None

      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)

            Assignee:
            jeff.yemin@mongodb.com Jeffrey Yemin
            Reporter:
            jeff.yemin@mongodb.com Jeffrey Yemin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: