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

mod on empty string field causes read of byte before field name during validation

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Minor - P4 Minor - P4
    • None
    • None
    • Write Ops
    • None
    • ALL

    Description

                      uassert( 10149,
                               "Invalid mod field name, may not end in a period",
                               fieldName[ strlen( fieldName ) - 1 ] != '.' );

      If strlen( fieldName ) == 0, this will read a character before the beginning of fieldName. Because fieldName will point to a field name within a bson element, this will not cause undefined or incorrect behavior currently. But we might want to clean it up a bit.

      Test to trigger

      c = db.c;
      c.drop();
       
      c.save( {} );
      c.update( {}, { $set:{ '':4 } } );
      printjson( c.findOne() );

      Attachments

        Activity

          People

            Unassigned Unassigned
            aaron Aaron Staple
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: