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

Coverity analysis defect 121082: Division or modulo by zero

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 5.2.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Fully Compatible
    • ALL
    • QE 2021-11-15, QE 2021-11-29

      Division or modulo by zero

      The program will have undefined behavior, likely a crash. Division or modulo by zero results in undefined behavior.
      /src/mongo/db/query/plan_cache.h:283: DIVIDE_BY_ZERO 121082 Checking "numPartitions > 0UL" implies that "numPartitions" and "this->_numPartitions" may be up to 0 on the false branch.
      /src/mongo/db/query/plan_cache.h:284: DIVIDE_BY_ZERO 121082 In expression "cacheSize / numPartitions", division by expression "numPartitions" which may be zero has undefined behavior.

            Assignee:
            joshua.lapacik@mongodb.com Joshua Lapacik (Inactive)
            Reporter:
            xgen-internal-coverity Coverity Collector User
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: