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

Coverity analysis defect 101249: Using invalid iterator

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.3.1
    • Component/s: Internal Code
    • Labels:
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Sprint:
      Dev Tools 2019-11-04

      Description

      An invalid or past-the-end iterator is being used

      Defect 101249 (STATIC_C)
      Checker INVALIDATE_ITERATOR (subcategory none)
      File: /src/mongo/util/options_parser/value.cpp
      Function _ZNK5mongo17optionenvironment5Value8toStringB5cxx11Ev
      /src/mongo/util/options_parser/value.cpp, line: 223
      Function "end" creates an iterator.

                          sb << _stringMapVal.end()->first << ":" << _stringMapVal.end()->second;

      /src/mongo/util/options_parser/value.cpp, line: 223
      Dereferencing iterator "this->_stringMapVal.end()" though it is already past the end of its container.

                          sb << _stringMapVal.end()->first << ":" << _stringMapVal.end()->second;

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: