Coverity: add null-check invariant for index catalog entry in dbcheck

    • Type: Task
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Replication
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      What

      Add `invariant(indexCatalogEntry, str::stream() << "Index '" << indexName << "' not found during dbcheck extra keys scan")` immediately after the `findIndexByName` call at line 459 in `dbcheck.cpp`, before the pointer is dereferenced.

      Files: `dbcheck.cpp` (line 459).

      Resolves: SERVER-108614

      Why

      Coverity flags a potential null dereference on the catalog entry pointer. The `invariant` converts the silent null-dereference path into an explicit crash with a diagnostic message, which Coverity recognizes as a handled case. It also documents the assumption that the index must exist at this point in the scan.

            Assignee:
            Unassigned
            Reporter:
            Denis Trailin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: