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

Coverity analysis defect 103539: Using invalid iterator

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Works as Designed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Storage
    • Labels:
    • Operating System:
      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

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

              Dates

              • Created:
                Updated:
                Resolved: