From: Aki Tuomi Date: Thu, 13 Feb 2025 07:31:47 +0000 (+0200) Subject: quota: Fix integer type in quota_warning_match() X-Git-Tag: 2.4.1~203 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=77c71bf5d6784e5c9b12c8aeb792be93b5ca918c;p=thirdparty%2Fdovecot%2Fcore.git quota: Fix integer type in quota_warning_match() Found by static analysis --- diff --git a/src/plugins/quota/quota-util.c b/src/plugins/quota/quota-util.c index f4d59359bf..0409ce40a8 100644 --- a/src/plugins/quota/quota-util.c +++ b/src/plugins/quota/quota-util.c @@ -10,10 +10,10 @@ bool quota_warning_match(const struct quota_root_settings *w, { #define QUOTA_EXCEEDED(before, current, limit) \ ((before) < (uint64_t)(limit) && (current) >= (uint64_t)(limit)) - uint64_t bytes_limit = w->quota_storage_size * - w->quota_storage_percentage / 100; - uint64_t count_limit = w->quota_message_count * - w->quota_message_percentage / 100; + uint64_t bytes_limit = (uint64_t)w->quota_storage_size * + (uint64_t)w->quota_storage_percentage / 100ULL; + uint64_t count_limit = (uint64_t)w->quota_message_count * + (uint64_t)w->quota_message_percentage / 100ULL; if (strcmp(w->quota_warning_threshold, QUOTA_WARNING_THRESHOLD_OVER) == 0) { /* over quota (default) */ if (strcmp(w->quota_warning_resource, QUOTA_WARNING_RESOURCE_STORAGE) == 0 &&