[dovecot-cvs] dovecot/src/plugins/quota quota-dict.c, 1.9.2.8, 1.9.2.9

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


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

Modified Files:
      Tag: branch_1_0
	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.9.2.8
retrieving revision 1.9.2.9
diff -u -d -r1.9.2.8 -r1.9.2.9
--- quota-dict.c	19 Jan 2007 20:49:15 -0000	1.9.2.8
+++ quota-dict.c	14 Feb 2007 19:32:04 -0000	1.9.2.9
@@ -126,7 +126,11 @@
 	t_push();
 	ret = dict_lookup(root->dict, unsafe_data_stack_pool, path, &value);
 	if (ret > 0) {
-		*value_r = strtoull(value, NULL, 10);
+		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 0;
 	}



More information about the dovecot-cvs mailing list