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

Coverity analysis defect 99681: Pointer to local outside scope

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • None
    • None
    • Aggregation Framework
    • Fully Compatible
    • ALL

    Description

      Pointer to a local stack variable returned or used outside scope

      Defect 99681 (STATIC_C)
      Checker RETURN_LOCAL (subcategory none)
      File: /src/mongo/db/pipeline/aggregation_request.cpp
      Function mongo::AggregationRequest::parseFromBSON(mongo::NamespaceString, const mongo::BSONObj &)
      /src/mongo/db/pipeline/aggregation_request.cpp, line: 75
      Temporary variable of type "mongo::StringData const [6]" goes out of scope.

              const std::initializer_list<StringData> optionsParsedElseWhere = {

      /src/mongo/db/pipeline/aggregation_request.cpp, line: 93
      Using "optionsParsedElseWhere.begin()", which points to an out-of-scope temporary variable of type "mongo::StringData const [6]".

                  if (std::find(optionsParsedElseWhere.begin(), optionsParsedElseWhere.end(), fieldName) !=

      Attachments

        Activity

          People

            charlie.swanson@mongodb.com Charlie Swanson
            xgen-internal-coverity Coverity Collector User
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: