]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
quota: Fixed checking message count limit when saving multiple mails in transaction.
authorTimo Sirainen <tss@iki.fi>
Mon, 4 Apr 2011 20:18:31 +0000 (23:18 +0300)
committerTimo Sirainen <tss@iki.fi>
Mon, 4 Apr 2011 20:18:31 +0000 (23:18 +0300)
src/plugins/quota/quota.c

index 222718d4586fbae362dd14fe15683a6c837f5f95..9b062969869d7a5b6d96997b2ab2e07b168319b8 100644 (file)
@@ -1170,7 +1170,8 @@ static int quota_default_test_alloc(struct quota_transaction_context *ctx,
 
        *too_large_r = FALSE;
 
-       if (ctx->count_left != 0 && ctx->bytes_left >= ctx->bytes_used + size)
+       if ((int64_t)ctx->count_left >= ctx->count_used + 1 &&
+           (int64_t)ctx->bytes_left >= ctx->bytes_used + (off_t)size)
                return 1;
 
        roots = array_get(&ctx->quota->roots, &count);