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

Remove the null terminator check in IndexCatalogImpl::_isSpecOk() for the 'name' field

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Works as Designed
    • Icon: Major - P3 Major - P3
    • None
    • None
    • Storage
    • Storage Execution

    Description

      Right now if we pass an index spec with the 'name' field set to "f\0o", for example, then getting the string representation from the BSON element, using valueStringData(), returns "f". After this, we check if the string representation contains '\0', which could be safely removed since we should never encounter this scenario.

      const StringData name = nameElem.valueStringData();
      if (name.find('\0') != std::string::npos)
          return Status(ErrorCodes::CannotCreateIndex, "index name cannot contain NUL bytes");
      

      See here

      Attachments

        Activity

          People

            backlog-server-execution Backlog - Storage Execution Team
            gregory.wlodarek@mongodb.com Gregory Wlodarek
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: