]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
auth: Don't crash if auth_cache_size has a very small value.
authorTimo Sirainen <tss@iki.fi>
Wed, 8 Sep 2010 13:47:45 +0000 (14:47 +0100)
committerTimo Sirainen <tss@iki.fi>
Wed, 8 Sep 2010 13:47:45 +0000 (14:47 +0100)
src/auth/auth-cache.c

index 50dbfdaade40dce65839cf3d53cec6d68e90fc56..ca07b711e06b74ac611b082f2a141614d7b701e6 100644 (file)
@@ -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));