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

Coverity analysis defect 101249: Using invalid iterator

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

      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@mongodb.com Billy Donahue
            Reporter:
            xgen-internal-coverity Coverity Collector User
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: