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

Coverity analysis defect 99846: Don't call

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.3.14
    • Affects Version/s: None
    • Component/s: Storage
    • Labels:
      None
    • Fully Compatible
    • ALL

      The called function is unsafe for security related code

      Defect 99846 (STATIC_C)
      Checker DC.WEAK_CRYPTO (subcategory none)
      File: /src/mongo/db/modules/enterprise/src/queryable/queryable_mmapv1/queryable_alloc_state.cpp
      Function mongo::queryable::AllocState::selectPageForFree(mongo::queryable::DataFile **, unsigned long *)
      /src/mongo/db/modules/enterprise/src/queryable/queryable_mmapv1/queryable_alloc_state.cpp, line: 59
      "rand" should not be used for security related applications, as linear congruential algorithms are too easy to break.

              std::size_t pageToSelect = rand() % _numPagesAllocated;
      

            Assignee:
            daniel.gottlieb@mongodb.com Daniel Gottlieb (Inactive)
            Reporter:
            xgen-internal-coverity Coverity Collector User
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: