]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Squid with a misconfigured (too-small) shared memory cache might crash
authorAlex Rousskov <rousskov@measurement-factory.com>
Fri, 18 Dec 2015 04:30:52 +0000 (21:30 -0700)
committerAlex Rousskov <rousskov@measurement-factory.com>
Fri, 18 Dec 2015 04:30:52 +0000 (21:30 -0700)
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.

src/MemStore.cc

index a23325005d5090f775305e82a952e5a1c16befac..f30d2c4ddf16681a0b233bbf036d53c9d287cf32 100644 (file)
@@ -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<cache_key*>(e.key));
     }