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

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

    • 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: