From: Tianyin Xu Date: Mon, 28 Jan 2013 11:40:12 +0000 (-0700) Subject: Bug 3736: Floating point exception due to divide by zero X-Git-Tag: SQUID_3_2_7~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=864ee44cb5d7980bfbfc20fbdd0ba81550f85c92;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 8ecd6865df..7468f4610f 100644 --- a/src/store_dir.cc +++ b/src/store_dir.cc @@ -938,6 +938,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 */