Coverity analysis defect 101249: Using invalid iterator

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 4.3.1
    • Affects Version/s: None
    • Component/s: Internal Code
    • Fully Compatible
    • ALL
    • Dev Tools 2019-11-04
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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;
      

            Assignee:
            Billy Donahue
            Reporter:
            Coverity Collector User
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: