From: wessels <> Date: Wed, 4 Feb 1998 00:26:37 +0000 (+0000) Subject: add bogus value detection to parse_cachedir() X-Git-Tag: SQUID_3_0_PRE1~4194 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=893dbb06318d35761197d94dbab80aa7227d2dad;p=thirdparty%2Fsquid.git add bogus value detection to parse_cachedir() --- diff --git a/src/cache_cf.cc b/src/cache_cf.cc index 8cdd5a8b73..91b228805c 100644 --- a/src/cache_cf.cc +++ b/src/cache_cf.cc @@ -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;