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

Coverity analysis defect 73173: Logically dead code

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.1.8
    • Affects Version/s: None
    • Component/s: Security
    • Fully Compatible
    • Security 9 (09/18/15)

      Code can never be reached because of a logical contradiction

      Defect 73173 (STATIC_C)
      Checker DEADCODE (subcategory none)
      File: /src/mongo/db/modules/enterprise/src/sasl/auxprop_mongodb_internal.cpp
      Function mongo::<unnamed>::auxpropLookupMongoDBInternal(void *, sasl_server_params *, unsigned int, const char *, unsigned int)
      /src/mongo/db/modules/enterprise/src/sasl/auxprop_mongodb_internal.cpp, line: 166
      Assigning: "curRet" = "-20".

                      curRet = SASL_NOUSER;
      

      /src/mongo/db/modules/enterprise/src/sasl/auxprop_mongodb_internal.cpp, line: 182
      At condition "curRet != -20", the value of "curRet" must be equal to -20.

                  if (curRet != SASL_OK && curRet != SASL_NOUSER) {
      

      /src/mongo/db/modules/enterprise/src/sasl/auxprop_mongodb_internal.cpp, line: 182
      The condition "curRet != -20" cannot be true.

                  if (curRet != SASL_OK && curRet != SASL_NOUSER) {
      

      /src/mongo/db/modules/enterprise/src/sasl/auxprop_mongodb_internal.cpp, line: 183
      Execution cannot reach this statement: "break;".

                      break;
      

            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: