From: Tianyin Xu Date: Tue, 22 Jan 2013 04:42:19 +0000 (-0700) Subject: Bug 3736: Floating point exception due to divide by zero X-Git-Tag: SQUID_3_3_1~33 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e1a52f52a4a29cf27434a40d83734ceaec3ebecf;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 70196246fa..8b21afe7bf 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 */