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

Prevent nullptr access in checkCollectionOptions uassert

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 7.0.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Fully Compatible
    • ALL
    • 155

      This can be reproduced by running:

      db.runCommand(

      { create: 'view', viewOn: 'coll' }

      );

      db.runCommand({
      create: 'view',
      viewOn: 'coll',
      collation:

      { locale: 'en' }

      });

      The first command attempts to create a view, but it fails with the error code OptionNotSupportedOnView. The second command should fail with the same error code, but instead segfaults inside checkCollectionOptions while attempting to raise this uassert.

      Collation is deliberately represented as a nullptr when there have been no special collation options set.

      This can be fixed by checking for a nullptr before raising the uassert.

            Assignee:
            jennifer.peshansky@mongodb.com Jennifer Peshansky (Inactive)
            Reporter:
            jennifer.peshansky@mongodb.com Jennifer Peshansky (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: