for (i = 0; i < swap->n_configured; i++) {
assert (swap->swapDirs[i].getRaw());
- if ((strcasecmp(path_str, dynamic_cast<SwapDir *>(swap->swapDirs[i].getRaw())->path)
- ) == 0) {
+ if ((strcasecmp(path_str, dynamic_cast<SwapDir *>(swap->swapDirs[i].getRaw())->path)) == 0) {
/* this is specific to on-fs Stores. The right
* way to handle this is probably to have a mapping
* from paths to stores, and have on-fs stores
}
/* new cache_dir */
- assert(swap->n_configured < 63); /* 7 bits, signed */
+ if(swap->n_configured > 63) {
+ /* 7 bits, signed */
+ debugs(3, DBG_CRITICAL, "WARNING: There is a fixed maximum of 63 cache_dir entries Squid can handle.");
+ debugs(3, DBG_CRITICAL, "WARNING: '" << path_str << "' is one to many.");
+ self_destruct();
+ return;
+ }
allocate_new_swapdir(swap);