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

Avoid past-the-end access of group by field in DocumentSourceBucket

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 8.1.0-rc0, 7.0.12, 7.3.4, 8.0.0-rc9
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Optimization
    • Fully Compatible
    • ALL
    • v8.0, v7.3, v7.0, v6.0, v5.0
    • 200

      In DocumentSourceBucket::createFromBson:

                  const bool groupByIsPrefixedPath =
                      groupByField.type() == BSONType::String && groupByField.valueStringData()[0] == '$';
      

      if groupby is an empty string, this accesses invalid memory - or in a debug build, fails an invariant in StringData::operator[]() as pos() > size().

            Assignee:
            james.harrison@mongodb.com James Harrison
            Reporter:
            james.harrison@mongodb.com James Harrison
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: