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

index ed341d12248f2b6801816da84c1b9f51306e084e..be1337e0972cc6361f3c0dbeaf6017ea4b9574ab 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 */