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

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Works as Designed
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Storage
    • Storage Execution
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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

            Assignee:
            [DO NOT USE] Backlog - Storage Execution Team
            Reporter:
            Gregory Wlodarek
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: