From: Alex Rousskov Date: Fri, 18 Dec 2015 04:30:52 +0000 (-0700) Subject: Squid with a misconfigured (too-small) shared memory cache might crash X-Git-Tag: SQUID_4_0_4~34 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5b675efaef119656d5997f0b67cf9e620eb1765a;p=thirdparty%2Fsquid.git Squid with a misconfigured (too-small) shared memory cache might crash upon startup. Controller condition for allocating MemStore is slightly different from MemStore condition for allocating MemStore::map, resulting in MemStore without a map. Until that discrepancy is fixed, be careful when dereferencing MemStore::map. --- diff --git a/src/MemStore.cc b/src/MemStore.cc index a23325005d..f30d2c4ddf 100644 --- a/src/MemStore.cc +++ b/src/MemStore.cc @@ -705,7 +705,7 @@ MemStore::unlink(StoreEntry &e) if (e.mem_obj && e.mem_obj->memCache.index >= 0) { map->freeEntry(e.mem_obj->memCache.index); disconnect(e); - } else { + } else if (map) { // the entry may have been loaded and then disconnected from the cache map->freeEntryByKey(reinterpret_cast(e.key)); }