dovecot-2.2: quota-dict: It wasn't possible to use multiple quot...

dovecot at dovecot.org dovecot at dovecot.org
Sat May 9 16:59:23 UTC 2015


details:   http://hg.dovecot.org/dovecot-2.2/rev/8b452eb97422
changeset: 18618:8b452eb97422
user:      Timo Sirainen <tss at iki.fi>
date:      Sat May 09 19:57:28 2015 +0300
description:
quota-dict: It wasn't possible to use multiple quota settings.
Found by Coverity

diffstat:

 src/plugins/quota/quota-dict.c |  19 +++++++------------
 1 files changed, 7 insertions(+), 12 deletions(-)

diffs (46 lines):

diff -r 398d94f08407 -r 8b452eb97422 src/plugins/quota/quota-dict.c
--- a/src/plugins/quota/quota-dict.c	Sat May 09 19:50:14 2015 +0300
+++ b/src/plugins/quota/quota-dict.c	Sat May 09 19:57:28 2015 +0300
@@ -44,25 +44,19 @@
 	username = t_strdup_until(args, p);
 	args = p+1;
 
-	do {
+	for (;;) {
 		/* FIXME: pretty ugly in here. the parameters should have
 		   been designed to be extensible. do it in a future version */
 		if (strncmp(args, "noenforcing:", 12) == 0) {
 			_root->no_enforcing = TRUE;
 			args += 12;
-			continue;
-		}
-		if (strncmp(args, "hidden:", 7) == 0) {
+		} else if (strncmp(args, "hidden:", 7) == 0) {
 			_root->hidden = TRUE;
 			args += 7;
-			continue;
-		}
-		if (strncmp(args, "ignoreunlimited:", 16) == 0) {
+		} else if (strncmp(args, "ignoreunlimited:", 16) == 0) {
 			_root->disable_unlimited_tracking = TRUE;
 			args += 16;
-			continue;
-		}
-		if (strncmp(args, "ns=", 3) == 0) {
+		} else if (strncmp(args, "ns=", 3) == 0) {
 			p = strchr(args, ':');
 			if (p == NULL)
 				break;
@@ -70,9 +64,10 @@
 			_root->ns_prefix = p_strdup_until(_root->pool,
 							  args + 3, p);
 			args = p + 1;
-			continue;
+		} else {
+			break;
 		}
-	} while (0);
+	}
 
 	if (*username == '\0')
 		username = _root->quota->user->username;


More information about the dovecot-cvs mailing list