Coverity analysis defect 135206: Division or modulo by float zero

XMLWordPrintableJSON

    • Storage Execution
    • Fully Compatible
    • ALL
    • Execution Team 2023-03-06
    • 135
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Division or modulo by float zero

      This could cause an immediate crash or incorrect computation. An expression which may be zero is used as a divisor in floating-point arithmetic.
      /src/mongo/db/storage/collection_markers.cpp:466: DIVIDE_BY_ZERO 135206 Checking "numRecords == 0LL" implies that "numRecords" is 0 on the true branch.
      /src/mongo/db/storage/collection_markers.cpp:487: DIVIDE_BY_ZERO 135206 In expression "(double)dataSize / (double)numRecords", division by expression "numRecords" which may be zero has undefined behavior.

            Assignee:
            Haley Connelly
            Reporter:
            Coverity Collector User
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: