From: Timo Sirainen Date: Wed, 8 Sep 2010 13:47:45 +0000 (+0100) Subject: auth: Don't crash if auth_cache_size has a very small value. X-Git-Tag: 2.0.2~9 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1e50a4f930a028ab5fcf690503bfd13b54ff6787;p=thirdparty%2Fdovecot%2Fcore.git auth: Don't crash if auth_cache_size has a very small value. --- diff --git a/src/auth/auth-cache.c b/src/auth/auth-cache.c index 50dbfdaade..ca07b711e0 100644 --- a/src/auth/auth-cache.c +++ b/src/auth/auth-cache.c @@ -242,7 +242,7 @@ void auth_cache_insert(struct auth_cache *cache, struct auth_request *request, sizeof(node->data) + data_size; /* make sure we have enough space */ - while (cache->size_left < alloc_size) + while (cache->size_left < alloc_size && cache->tail != NULL) auth_cache_node_destroy(cache, cache->tail); node = hash_table_lookup(cache->hash, str_c(str));