Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-14398

validateBSON() should reject Arrays whose field names do not match the BSON spec.

    XMLWordPrintableJSON

Details

    • Minor Change
    • ALL

    Description

      At least C driver under some uses constructs arrays without the field names. We should not silently fail, but rather reject the input.

      The BSON Spec is ambiguous, but what it's supposed to say is that a BSON array is encoded like an object, where the field name of each element is the UTF-8 string of the base-10 encoding of the element's position in the array. The first element has field name "0", the second "1", the eleventh "10", and so on.

      The validateBSON() method is used by the server in standard operation to validate the incoming BSON adheres to the spec, and we should extend its implementation to also validate array field names.

      Attachments

        Activity

          People

            backlog-server-platform DO NOT USE - Backlog - Platform Team
            alex.komyagin@mongodb.com Alexander Komyagin
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

            Dates

              Created:
              Updated: