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/s/shardsvr_get_stats_for_balancing_command.cpp:111: DIVIDE_BY_ZERO 122087 Assigning: "numRecords" = "autoColl->numRecords(opCtx)". The value of "numRecords" is now 0.
/src/mongo/db/s/shardsvr_get_stats_for_balancing_command.cpp:130: DIVIDE_BY_ZERO 122087 In expression "dataSizeBytes / numRecords", division by expression "numRecords" which may be zero has undefined behavior.
- is duplicated by
-
SERVER-65326 Coverity analysis defect 122032: Division or modulo by zero
-
- Closed
-