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

Coverity analysis defect 98181: Logically dead code

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 3.3.8
    • Affects Version/s: None
    • Component/s: Security
    • None
    • Fully Compatible
    • ALL
    • Security 12 (04/01/16), Security 13 (04/22/16), Security 14 (05/13/16), Security 15 (06/03/16)

      Code can never be reached because of a logical contradiction

      Defect 98181 (STATIC_C)
      Checker DEADCODE (subcategory none)
      File: /src/mongo/db/modules/enterprise/src/ldap/connections/openldap_connection.cpp
      Function mongo::OpenLDAPConnection::connect()
      /src/mongo/db/modules/enterprise/src/ldap/connections/openldap_connection.cpp, line: 219
      The result of pointer arithmetic "++it" is never null.

                          if (++it == nullptr) {
      

      /src/mongo/db/modules/enterprise/src/ldap/connections/openldap_connection.cpp, line: 219
      At condition "+it == NULL", the value of "+it" cannot be "NULL".

                          if (++it == nullptr) {
      

      /src/mongo/db/modules/enterprise/src/ldap/connections/openldap_connection.cpp, line: 219
      The condition "++it == NULL" cannot be true.

                          if (++it == nullptr) {
      

      /src/mongo/db/modules/enterprise/src/ldap/connections/openldap_connection.cpp, line: 220
      Execution cannot reach this statement: "log << "], ";".

                              log << "], ";
      

            Assignee:
            andreas.nilsson Andreas Nilsson
            Reporter:
            xgen-internal-coverity Coverity Collector User
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: