Uploaded image for project: 'C++ Driver'
  1. C++ Driver
  2. CXX-1725

Coverity analysis defect 105003: Dereference after null check

    • Type: Icon: Bug Bug
    • Resolution: Won't Fix
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: Testing
    • Labels:
      None

      Pointer is checked against null but then dereferenced anyway

      Defect 105003 (STATIC_C)
      Checker FORWARD_NULL (subcategory none)
      File: /src/mongocxx/test/spec/change_stream.cpp
      Function <unnamed>::____C_A_T_C_H____T_E_S_T____2()
      /src/mongocxx/test/spec/change_stream.cpp, line: 165
      Comparing "change_stream_tests_path" to null implies that "change_stream_tests_path" might be null.

              if (!change_stream_tests_path) {
      

      /src/mongocxx/test/spec/change_stream.cpp, line: 169
      Passing null pointer "change_stream_tests_path" to "basic_string", which dereferences it.

              std::string path = change_stream_tests_path;
      

            Assignee:
            Unassigned Unassigned
            Reporter:
            xgen-internal-coverity Coverity Collector User
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: