dovecot-2.0: doveadm quota get: Avoid integer overflows with rea...

dovecot at dovecot.org dovecot at dovecot.org
Wed Jun 2 22:10:26 EEST 2010


details:   http://hg.dovecot.org/dovecot-2.0/rev/3b25ca20f005
changeset: 11467:3b25ca20f005
user:      Timo Sirainen <tss at iki.fi>
date:      Wed Jun 02 20:10:23 2010 +0100
description:
doveadm quota get: Avoid integer overflows with really high quota usage.

diffstat:

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

diffs (15 lines):

diff -r 5ae4a5c14f5b -r 3b25ca20f005 src/plugins/quota/doveadm-quota.c
--- a/src/plugins/quota/doveadm-quota.c	Wed Jun 02 19:52:32 2010 +0100
+++ b/src/plugins/quota/doveadm-quota.c	Wed Jun 02 20:10:23 2010 +0100
@@ -28,9 +28,9 @@
 			printf("%llu/%llu",
 			       (unsigned long long)value,
 			       (unsigned long long)limit);
-			if (limit != 0) {
+			if (limit >= 100) {
 				printf(" (%u%%)",
-				       (unsigned int)(value*100/limit));
+				       (unsigned int)(value / (limit/100)));
 			}
 		} else if (ret == 0) {
 			printf("%llu/unlimited",


More information about the dovecot-cvs mailing list