From: Tianyin Xu Date: Sat, 12 Jan 2013 09:53:15 +0000 (-0700) Subject: Bug 3736: Floating point exception due to divide by zero X-Git-Tag: SQUID_3_4_0_1~385 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=90d881c4fa0fc6d3a480be6fd9b701d1068dfaeb;p=thirdparty%2Fsquid.git Bug 3736: Floating point exception due to divide by zero --- diff --git a/src/store_dir.cc b/src/store_dir.cc index ed341d1224..be1337e097 100644 --- a/src/store_dir.cc +++ b/src/store_dir.cc @@ -944,6 +944,12 @@ StoreHashIndex::get(String const key, STOREGETCLIENT aCallback, void *aCallbackD void StoreHashIndex::init() { + if (Config.Store.objectsPerBucket <= 0) + fatal("'store_objects_per_bucket' should be larger than 0."); + + if (Config.Store.avgObjectSize <= 0) + fatal("'store_avg_object_size' should be larger than 0."); + /* Calculate size of hash table (maximum currently 64k buckets). */ /* this is very bogus, its specific to the any Store maintaining an * in-core index, not global */