From: Timo Sirainen Date: Tue, 22 Sep 2015 11:26:08 +0000 (+0300) Subject: quota: Make sure the limit return value is initialized when quota_get_resource()... X-Git-Tag: 2.2.19.rc1~15 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=68d7af0bb1d5f9da9dffda7d0616e99624d784e6;p=thirdparty%2Fdovecot%2Fcore.git 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. --- 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;