zmike pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=d417868c90cca3d6bcbe6fa89ffdfc1cccfa2932

commit d417868c90cca3d6bcbe6fa89ffdfc1cccfa2932
Author: Mike Blumenkrantz <zm...@samsung.com>
Date:   Fri Oct 18 13:29:07 2019 -0400

    benchmarks/eina: fix possible div by zero in ecore_hash
    
    Summary: CID 1400768
    
    Reviewers: devilhorns
    
    Reviewed By: devilhorns
    
    Subscribers: cedric, #reviewers, #committers
    
    Tags: #efl
    
    Differential Revision: https://phab.enlightenment.org/D10397
---
 src/benchmarks/eina/ecore_hash.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/benchmarks/eina/ecore_hash.c b/src/benchmarks/eina/ecore_hash.c
index 76a5ad2e38..ae9befa6b5 100644
--- a/src/benchmarks/eina/ecore_hash.c
+++ b/src/benchmarks/eina/ecore_hash.c
@@ -416,6 +416,7 @@ ecore_hash_dump_stats(Ecore_Hash *hash)
    unsigned int i;
    double variance, sum_n_2 = 0, sum_n = 0;
 
+   if (!hash->size) return;
    for (i = 0; i < ecore_prime_table[hash->size]; i++)
      {
         if (hash->buckets[i])

-- 


Reply via email to