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

Coverity analysis defect 103475: Invalid iterator comparison

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.4.15, 3.6.5, 3.7.5
    • Component/s: Security
    • Labels:
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Backport Requested:
      v3.6, v3.4
    • Sprint:
      Platforms 2018-04-23

      Description

      Iterators that point to different containers are compared

      Defect 103475 (STATIC_C)
      Checker MISMATCHED_ITERATOR (subcategory mismatched_comparison)
      File: /src/mongo/util/net/ssl_options.cpp
      Function mongo::<unnamed>::storeDisabledProtocols(const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> &, mongo::<unnamed>::DisabledProtocolsMode)
      /src/mongo/util/net/ssl_options.cpp, line: 111
      "validNoConfigs.find(token)" returns an iterator for "validNoConfigs".

                      mappedToken = validNoConfigs.find(token);

      /src/mongo/util/net/ssl_options.cpp, line: 111
      Assigning: "mappedToken" = "validNoConfigs.find(token)".

                      mappedToken = validNoConfigs.find(token);

      /src/mongo/util/net/ssl_options.cpp, line: 114
      "validConfigs.end()" returns an iterator for "validConfigs".

                  if (mappedToken != validConfigs.end()) {

      /src/mongo/util/net/ssl_options.cpp, line: 114
      Comparing "mappedToken" from "validNoConfigs" to "validConfigs.end()" from "validConfigs".

                  if (mappedToken != validConfigs.end()) {

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: