Coverity DIVIDE_BY_ZERO - CID 10199
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
dee | Status tracked in 1.0 | |||||
1.0 |
New
|
Medium
|
Unassigned |
Bug Description
This bug is exported from the Coverity Integration Manager on Canonical's servers. For information on how this is done please see this website: https:/
CID: 10199
Checker: DIVIDE_BY_ZERO
Category: No category available
CWE definition: http://
File: /tmp/buildd/
Function: run_benchmark()
Code snippet:
77 total_runtime += bench->
78 }
79
80 /* Compute average runtime */
CID 10199 - DIVIDE_BY_ZERO
Division by expression "bench->n_runs" which may be zero has undefined behavior
81 avg_runtime = total_runtime / bench->n_runs;
82
83 /* Compute standard deviation */
84 std_dev = 0;
85 for (i = 0; i < bench->n_runs; i++)
86 {
Source file with Coverity annotations.