]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug 3736: Floating point exception due to divide by zero
authorTianyin Xu <tixu@cs.ucsd.edu>
Tue, 22 Jan 2013 04:42:19 +0000 (21:42 -0700)
committerAmos Jeffries <squid3@treenet.co.nz>
Tue, 22 Jan 2013 04:42:19 +0000 (21:42 -0700)
src/store_dir.cc

index 70196246fabbc1820d19828dd674b69ad524f6e1..8b21afe7bfaf840c2901d3d0a6eb00c6bdd5945f 100644 (file)
@@ -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 */