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

index 8ecd6865df0468c8299cc5a6f777f50cacc3ed55..7468f4610f571569f1e1e32d7672169211e6f2a8 100644 (file)
@@ -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 */