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

Coverity analysis defect 121640: Unchecked dynamic_cast

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 6.0.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
    • Fully Compatible
    • ALL

      Unchecked dynamic_cast

      If the dynamic_cast fails, a null pointer dereference will occur; if the dynamic_cast cannot fail, using static_cast instead offers better performance. Dynamic_cast may fail and return null if the type cast is incompatible
      /src/mongo/db/modules/enterprise/src/search/mongot_cursor.cpp:100: FORWARD_NULL 121640 Dynamic cast to pointer "dynamic_cast <mongo::DocumentSourceInternalSearchMongotRemote *>(potentialSearchStage.get())" can return "NULL".
      /src/mongo/db/modules/enterprise/src/search/mongot_cursor.cpp:100: FORWARD_NULL 121640 Assigning: "origSearchStage" = "dynamic_cast <mongo::DocumentSourceInternalSearchMongotRemote *>(potentialSearchStage.get())".

            Assignee:
            ted.tuckman@mongodb.com Ted Tuckman
            Reporter:
            xgen-internal-coverity Coverity Collector User
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: