=== modified file 'src/cache_cf.cc' --- src/cache_cf.cc 2010-07-07 16:41:03 +0000 +++ src/cache_cf.cc 2010-07-15 07:40:11 +0000 @@ -622,6 +622,10 @@ if (Config.errHtmlText == NULL) Config.errHtmlText = xstrdup(null_string); + if (Config.local_file_dir != NULL) { + requirePathnameExists("local_file_dir", Config.local_file_dir); + } + storeConfigure(); snprintf(ThisCache, sizeof(ThisCache), "%s (%s)", @@ -2476,17 +2480,26 @@ pattern = xstrdup(token); i = GetInteger(); /* token: min */ - min = (time_t) (i * 60); /* convert minutes to seconds */ + /* catch insanely huge values close to 32-bit wrap */ + if (min < i || min > 60*60*24*365) { + debugs(3, DBG_IMPORTANT, "WARNING: refresh_pattern minimum age too high. Cropped back to 1 year."); + min = 60*60*24*365; + } + i = GetInteger(); /* token: pct */ - pct = (double) i / 100.0; i = GetInteger(); /* token: max */ - max = (time_t) (i * 60); /* convert minutes to seconds */ + /* catch insanely huge values close to 32-bit wrap */ + if (max < i || max > 60*60*24*365) { + debugs(3, DBG_IMPORTANT, "WARNING: refresh_pattern maximum age too high. Cropped back to 1 year."); + max = 60*60*24*365; + } + /* Options */ while ((token = strtok(NULL, w_space)) != NULL) { if (!strcmp(token, "refresh-ims")) {