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

IDL generated parsers do not validate that the input element is a BSON array for attributes of type array<type>

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Won't Fix
    • 4.5 Desired
    • None
    • IDL
    • None
    • ALL
    • Hide
      1. Define an attribute of an object in *.idl file like below.

         
        cursors:
            description: "An array of cursor IDs to be killed."
            type: array<cursorId>
            cpp_name: cursorIds
            optional: false
        

      2. Pass an array-like object as a value of the field:

        cursors:{
         '0': 10000,
         '1': 20000
        }
        

      3. The object is successfully parsed.
      Show
      Define an attribute of an object in *.idl file like below. cursors: description: "An array of cursor IDs to be killed." type: array<cursorId> cpp_name: cursorIds optional: false Pass an array-like object as a value of the field: cursors:{ '0': 10000, '1': 20000 } The object is successfully parsed.

    Description

      IDL generated parsers do not validate that the input element is a BSON array for attributes of type array<type>. The parsers do accept both - BSON arrays and objects with array layout (please see Steps To Reproduce for an example). Expected behavior is that only BSON arrays are accepted.

      Attachments

        Activity

          People

            garaudy.etienne@mongodb.com Garaudy Etienne
            mindaugas.malinauskas@mongodb.com Mindaugas Malinauskas
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: