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

StageBuilder should have an explicit invariant that calls to findIndexByKeyPattern() return non-null

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.3.8
    • Affects Version/s: None
    • Component/s: Querying
    • Fully Compatible
    • ALL
    • Query 16 (06/24/16)

      Return value of function which returns null is dereferenced without checking

      Defect 99343 (STATIC_C)
      Checker NULL_RETURNS (subcategory none)
      File: /src/mongo/db/query/stage_builder.cpp
      Function mongo::buildStages(mongo::OperationContext *, mongo::Collection *, const mongo::CanonicalQuery &, const mongo::QuerySolution &, const mongo::QuerySolutionNode *, mongo::WorkingSet *)
      /src/mongo/db/query/stage_builder.cpp, line: 308
      Assigning: "params.descriptor" = null return value from "findIndexByKeyPattern".

                  params.descriptor =
      

      File: /src/mongo/db/query/stage_builder.cpp
      Function mongo::buildStages(mongo::OperationContext *, mongo::Collection *, const mongo::CanonicalQuery &, const mongo::QuerySolution &, const mongo::QuerySolutionNode *, mongo::WorkingSet *)
      /src/mongo/db/query/stage_builder.cpp, line: 324
      Assigning: "params.descriptor" = null return value from "findIndexByKeyPattern".

                  params.descriptor =
      

            Assignee:
            david.storch@mongodb.com David Storch
            Reporter:
            xgen-internal-coverity Coverity Collector User
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: