From 68d7af0bb1d5f9da9dffda7d0616e99624d784e6 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Tue, 22 Sep 2015 14:26:08 +0300 Subject: [PATCH] quota: Make sure the limit return value is initialized when quota_get_resource() returns 0 Later on a debug log message in quota_over_flag_check_root() was accessing the limit, which wasn't necessarily initialized. Also initialized value return value just as well to be safe. --- src/plugins/quota/quota.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/plugins/quota/quota.c b/src/plugins/quota/quota.c index ca9ac2f899..6337925954 100644 --- a/src/plugins/quota/quota.c +++ b/src/plugins/quota/quota.c @@ -666,6 +666,8 @@ int quota_get_resource(struct quota_root *root, const char *mailbox_name, bool kilobytes = FALSE; int ret; + *value_r = *limit_r = 0; + if (strcmp(name, QUOTA_NAME_STORAGE_KILOBYTES) == 0) { name = QUOTA_NAME_STORAGE_BYTES; kilobytes = TRUE; -- 2.47.3