Coverity analysis defect 99681: Pointer to local outside scope

XMLWordPrintableJSON

    • Fully Compatible
    • ALL
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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) !=
      

            Assignee:
            Charlie Swanson
            Reporter:
            Coverity Collector User
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: