Coverity analysis defect 164196: Unchecked dynamic_cast

XMLWordPrintableJSON

    • Storage Execution
    • Fully Compatible
    • ALL
    • Execution Team 2025-02-17
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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
      /data/bazel_cache/1de52aaeb35278243ca29a4785ce7969/execroot/_main_/src/mongo/db/storage/wiredtiger/wiredtiger_record_store_test_harness.cpp:136: FORWARD_NULL 164196 Dynamic cast to pointer "dynamic_cast <mongo::WiredTigerRecordStore::Oplog *>(ret.get())" can return "NULL".
      /data/bazel_cache/1de52aaeb35278243ca29a4785ce7969/execroot/_main_/src/mongo/db/storage/wiredtiger/wiredtiger_record_store_test_harness.cpp:136: FORWARD_NULL 164196 Assigning: "oplog" = "dynamic_cast <mongo::WiredTigerRecordStore::Oplog *>(ret.get())".

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

              Created:
              Updated:
              Resolved: