Uploaded image for project: 'Ruby Driver'
  1. Ruby Driver
  2. RUBY-2263

Add validations tested by bson corpus

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • bson-4.9.0
    • Affects Version/s: None
    • Component/s: BSON
    • Labels:
      None
    • bson-ruby now performs more validations when decoding BSON documents. Some decodable but technically invalid documents will be rejected. Some documents that are not decodable will be flagged as such earlier in the decoding process.
    • Minor Change

      Currently on master when the failing tests in bson corpus are run, the bson content is not hex-decoded before being attempted to be decoded as bson. As a result, all of the decoding attempts fail (which makes all tests pass) but the library does not actually fail parsing of a number of cases once the input data is properly hex-decoded.

      Add hex-decoding of bson input data to corpus spec runner for expected failures
      Enforce that strings are valid utf-8 byte sequences when reading strings and symbols
      Enforce that strings end with null bytes
      Verify hashes' byte sizes are equal to claimed byte sizes
      Verify arrays' byte sizes are equal to claimed byte sizes
      Verify code with scope length is correct

      The hash and array byte size verification in particular helps ensure that after invalid arrays/hashes, bson-ruby does not attempt to continue reading a potentially broken byte stream.

            Assignee:
            oleg.pudeyev@mongodb.com Oleg Pudeyev (Inactive)
            Reporter:
            oleg.pudeyev@mongodb.com Oleg Pudeyev (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: