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

Coverity analysis defect 105058: Dereference after null check

    XMLWordPrintable

    Details

    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL

      Description

      Pointer is checked against null but then dereferenced anyway

      Defect 105058 (STATIC_C)
      Checker FORWARD_NULL (subcategory none)
      File: /src/mongo/db/pipeline/pipeline_d.cpp
      Function mongo::PipelineD::prepareExecutor(mongo::OperationContext *, mongo::Collection *, const mongo::NamespaceString &, mongo::Pipeline *, const boost::intrusive_ptr<mongo::ExpressionContext> &, bool, const boost::intrusive_ptr<mongo::DocumentSourceSort> &, std::unique_ptr<mongo::GroupFromFirstDocumentTransformation, std::default_delete<mongo::GroupFromFirstDocumentTransformation>>, const mongo::DepsTracker &, const mongo::BSONObj &, const mongo::AggregationRequest *, const unsigned long long &, mongo::BSONObj *, mongo::BSONObj *)
      /src/mongo/db/pipeline/pipeline_d.cpp, line: 554
      Comparing "sortObj" to null implies that "sortObj" might be null.

                  auto swExecutorGrouped = attemptToGetExecutor(opCtx,

      File: /src/mongo/db/pipeline/pipeline_d.cpp
      Function mongo::PipelineD::prepareExecutor(mongo::OperationContext *, mongo::Collection *, const mongo::NamespaceString &, mongo::Pipeline *, const boost::intrusive_ptr<mongo::ExpressionContext> &, bool, const boost::intrusive_ptr<mongo::DocumentSourceSort> &, std::unique_ptr<mongo::GroupFromFirstDocumentTransformation, std::default_delete<mongo::GroupFromFirstDocumentTransformation>>, const mongo::DepsTracker &, const mongo::BSONObj &, const mongo::AggregationRequest *, const unsigned long long &, mongo::BSONObj *, mongo::BSONObj *)
      /src/mongo/db/pipeline/pipeline_d.cpp, line: 554
      Comparing "sortObj" to null implies that "sortObj" might be null.

                  auto swExecutorGrouped = attemptToGetExecutor(opCtx,

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated: