dee

Coverity DIVIDE_BY_ZERO - CID 10198

Bug #937414 reported by Product Strategy Coverity Bug Uploader
This bug report is a duplicate of:  Bug #904995: Coverity DIVIDE_BY_ZERO - CID 10028. Edit Remove
0
This bug affects 1 person
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://wiki.ubuntu.com/CanonicalProductStrategy/Coverity
CID: 10198
Checker: DIVIDE_BY_ZERO
Category: No category available
CWE definition: http://cwe.mitre.org/data/definitions/571.html
File: /tmp/buildd/dee-1.0.4/tests/test-benchmark.c
Function: run_benchmark()
Code snippet:
 86 {
 87 gdouble delta = bench->runs[i].elapsed - avg_runtime;
 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)

Revision history for this message
Product Strategy Coverity Bug Uploader (coverity-uploader) wrote : dee-1.0: /tmp/buildd/dee-1.0.4/tests/test-benchmark.c

Source file with Coverity annotations.

Changed in dee:
importance: Undecided → Medium
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.