Coverity analysis defect 103539: Using invalid iterator

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Works as Designed
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Storage
    • Storage Execution
    • ALL
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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;
      

            Assignee:
            [DO NOT USE] Backlog - Storage Execution Team
            Reporter:
            Coverity Collector User
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: