dovecot-2.0: doveadm quota: Don't crash if quota isn't enabled.
dovecot at dovecot.org
dovecot at dovecot.org
Thu Dec 30 12:45:57 EET 2010
details: http://hg.dovecot.org/dovecot-2.0/rev/a293626e09e2
changeset: 12532:a293626e09e2
user: Timo Sirainen <tss at iki.fi>
date: Thu Dec 30 12:45:52 2010 +0200
description:
doveadm quota: Don't crash if quota isn't enabled.
diffstat:
src/plugins/quota/doveadm-quota.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diffs (23 lines):
diff -r 15c32384817b -r a293626e09e2 src/plugins/quota/doveadm-quota.c
--- a/src/plugins/quota/doveadm-quota.c Thu Dec 30 12:40:50 2010 +0200
+++ b/src/plugins/quota/doveadm-quota.c Thu Dec 30 12:45:52 2010 +0200
@@ -49,6 +49,9 @@
struct quota_user *quser = QUOTA_USER_CONTEXT(user);
struct quota_root *const *root;
+ if (quser == NULL)
+ i_fatal("Quota not enabled");
+
array_foreach(&quser->quota->roots, root)
cmd_quota_get_root(*root);
}
@@ -86,6 +89,9 @@
struct quota_root *const *root;
struct quota_transaction_context trans;
+ if (quser == NULL)
+ i_fatal("Quota not enabled");
+
memset(&trans, 0, sizeof(trans));
trans.quota = quser->quota;
trans.recalculate = TRUE;
More information about the dovecot-cvs
mailing list