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

Coverity analysis defect 103475: Invalid iterator comparison

    • Fully Compatible
    • ALL
    • v3.6, v3.4
    • Platforms 2018-04-23

      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()) {
      

            Assignee:
            sara.golemon@mongodb.com Sara Golemon
            Reporter:
            xgen-internal-coverity Coverity Collector User
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: