Coverity analysis defect 121082: Division or modulo by zero

XMLWordPrintableJSON

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

      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 (Inactive)
            Reporter:
            Coverity Collector User
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: