[dovecot-cvs] dovecot/src/plugins/quota quota-dict.c,1.18,1.19

tss at dovecot.org tss at dovecot.org
Wed Feb 14 19:32:08 UTC 2007


Update of /var/lib/cvs/dovecot/src/plugins/quota
In directory talvi:/tmp/cvs-serv1269

Modified Files:
	quota-dict.c 
Log Message:
Don't break if current quota value is negative.



Index: quota-dict.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/plugins/quota/quota-dict.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- quota-dict.c	3 Dec 2006 18:55:38 -0000	1.18
+++ quota-dict.c	14 Feb 2007 19:32:06 -0000	1.19
@@ -118,8 +118,13 @@
 		*value_r = 0;
 	else if (ret == 0)
 		ret = dict_quota_count(root, want_bytes, value_r);
-	else
-		*value_r = strtoull(value, NULL, 10);
+	else {
+		long long tmp;
+
+		/* don't break in case the quota value is negative. */
+		tmp = strtoll(value, NULL, 10);
+		*value_r = tmp < 0 ? 0 : tmp;
+	}
 
 	t_pop();
 	return ret;



More information about the dovecot-cvs mailing list