]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
add bogus value detection to parse_cachedir()
authorwessels <>
Wed, 4 Feb 1998 00:26:37 +0000 (00:26 +0000)
committerwessels <>
Wed, 4 Feb 1998 00:26:37 +0000 (00:26 +0000)
src/cache_cf.cc

index 8cdd5a8b73610850d9b5eaff6c2867de6bc707d0..91b228805c9f98ebcc2b5670b5c4dc1e56e6b805 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: cache_cf.cc,v 1.242 1998/01/12 04:29:56 wessels Exp $
+ * $Id: cache_cf.cc,v 1.243 1998/02/03 17:26:37 wessels Exp $
  *
  * DEBUG: section 3     Configuration File Parsing
  * AUTHOR: Harvest Derived
@@ -506,10 +506,16 @@ parse_cachedir(struct _cacheSwap *swap)
        self_destruct();
     GetInteger(i);
     size = i << 10;            /* Mbytes to kbytes */
+    if (size <= 0)
+       fatal("parse_cachedir: invalid size value");
     GetInteger(i);
     l1 = i;
+    if (l1 <= 0)
+       fatal("parse_cachedir: invalid level 1 directories value");
     GetInteger(i);
     l2 = i;
+    if (l2 <= 0)
+       fatal("parse_cachedir: invalid level 2 directories value");
     if ((token = strtok(NULL, w_space)))
        if (!strcasecmp(token, "read-only"))
            readonly = 1;