dovecot-2.2: quota: Make sure the limit return value is initiali...

dovecot at dovecot.org dovecot at dovecot.org
Tue Sep 22 11:27:29 UTC 2015


details:   http://hg.dovecot.org/dovecot-2.2/rev/e6b3170648c7
changeset: 19179:e6b3170648c7
user:      Timo Sirainen <tss at iki.fi>
date:      Tue Sep 22 14:26:08 2015 +0300
description:
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.

diffstat:

 src/plugins/quota/quota.c |  2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diffs (12 lines):

diff -r 11c1a5cf41f8 -r e6b3170648c7 src/plugins/quota/quota.c
--- a/src/plugins/quota/quota.c	Tue Sep 22 13:53:47 2015 +0300
+++ b/src/plugins/quota/quota.c	Tue Sep 22 14:26:08 2015 +0300
@@ -666,6 +666,8 @@
 	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;


More information about the dovecot-cvs mailing list