From 77c71bf5d6784e5c9b12c8aeb792be93b5ca918c Mon Sep 17 00:00:00 2001 From: Aki Tuomi Date: Thu, 13 Feb 2025 09:31:47 +0200 Subject: [PATCH] quota: Fix integer type in quota_warning_match() Found by static analysis --- src/plugins/quota/quota-util.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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 && -- 2.47.3