[dovecot-cvs] dovecot/src/plugins/quota quota-fs.c,1.11,1.12

cras at dovecot.org cras at dovecot.org
Sun Apr 9 18:08:25 EEST 2006


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

Modified Files:
	quota-fs.c 
Log Message:
Fixed calculation overflows



Index: quota-fs.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/plugins/quota/quota-fs.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- quota-fs.c	2 Apr 2006 17:42:30 -0000	1.11
+++ quota-fs.c	9 Apr 2006 15:08:23 -0000	1.12
@@ -284,8 +284,10 @@
 		return -1;
 	}
 #endif
-	*value_r = dqblk.dqb_curblocks * root->mount->blk_size / 1024;
-	*limit_r = dqblk.dqb_bsoftlimit * root->mount->blk_size / 1024;
+	*value_r = (uint64_t)dqblk.dqb_curblocks *
+		(uint64_t)root->mount->blk_size / 1024;
+	*limit_r = (uint64_t)dqblk.dqb_bsoftlimit *
+		(uint64_t)root->mount->blk_size / 1024;
 	return 1;
 }
 



More information about the dovecot-cvs mailing list