Coverity DIVIDE_BY_ZERO - CID 10198
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: 10198
Checker: DIVIDE_BY_ZERO
Category: No category available
CWE definition: http://
File: /tmp/buildd/
Function: run_benchmark()
Code snippet:
86 {
87 gdouble delta = bench->
88 std_dev += delta * delta;
89 }
CID 10198 - DIVIDE_BY_ZERO
Division by expression "bench->n_runs" which may be zero has undefined behavior
90 std_dev = sqrt (std_dev / bench->n_runs);
91 coeff_of_var = (std_dev /avg_runtime) * 100;
92
93 /* This is not a very precise way of judging the quality,
94 * but better than rigorous hand waving */
95 if (coeff_of_var < 1.0)
Source file with Coverity annotations.