]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
quota: Make sure the limit return value is initialized when quota_get_resource()...
authorTimo Sirainen <tss@iki.fi>
Tue, 22 Sep 2015 11:26:08 +0000 (14:26 +0300)
committerTimo Sirainen <tss@iki.fi>
Tue, 22 Sep 2015 11:26:08 +0000 (14:26 +0300)
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

index ca9ac2f899aa771022576f1ba5a868d99944bba1..6337925954e80e51ac650166f8dcdc2951747692 100644 (file)
@@ -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;