From: Timo Sirainen Date: Mon, 4 Apr 2011 20:18:31 +0000 (+0300) Subject: quota: Fixed checking message count limit when saving multiple mails in transaction. X-Git-Tag: 2.0.12~27 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c1838f0f2d07e2079e6c89110ef7424250eb4791;p=thirdparty%2Fdovecot%2Fcore.git quota: Fixed checking message count limit when saving multiple mails in transaction. --- diff --git a/src/plugins/quota/quota.c b/src/plugins/quota/quota.c index 222718d458..9b06296986 100644 --- a/src/plugins/quota/quota.c +++ b/src/plugins/quota/quota.c @@ -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);