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

Coverity analysis defect 103539: Using invalid iterator

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Works as Designed
    • Icon: Major - P3 Major - P3
    • None
    • None
    • Storage
    • Storage Execution
    • ALL

    Description

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

      Defect 103539 (STATIC_C)
      Checker INVALIDATE_ITERATOR (subcategory none)
      File: /src/mongo/db/storage/ephemeral_for_test/ephemeral_for_test_record_store.cpp
      Function mongo::EphemeralForTestRecordStore::recordFor(const mongo::RecordId &)
      /src/mongo/db/storage/ephemeral_for_test/ephemeral_for_test_record_store.cpp, line: 319
      Function "end" creates an iterator.

              if (it == _data->records.end()) {

      /src/mongo/db/storage/ephemeral_for_test/ephemeral_for_test_record_store.cpp, line: 319
      "it" testing equal to "this->_data->records.end()".

              if (it == _data->records.end()) {

      /src/mongo/db/storage/ephemeral_for_test/ephemeral_for_test_record_store.cpp, line: 324
      Dereferencing iterator "it" though it is already past the end of its container.

              return &it->second;

      Attachments

        Activity

          People

            backlog-server-execution Backlog - Storage Execution Team
            xgen-internal-coverity Coverity Collector User
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: