dovecot-2.0: lib-index: day_first_uid[] array wasn't kept proper...

dovecot at dovecot.org dovecot at dovecot.org
Tue Sep 14 23:12:11 EEST 2010


details:   http://hg.dovecot.org/dovecot-2.0/rev/8b6b0412dc18
changeset: 12120:8b6b0412dc18
user:      Timo Sirainen <tss at iki.fi>
date:      Tue Sep 14 21:12:08 2010 +0100
description:
lib-index: day_first_uid[] array wasn't kept properly up to date.
The result was that caching decisions could have been sometimes slightly wrong.
Based on patch by Paul E. Black.

diffstat:

 src/lib-index/mail-index-transaction-update.c |  3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diffs (13 lines):

diff -r fac83abe8aaf -r 8b6b0412dc18 src/lib-index/mail-index-transaction-update.c
--- a/src/lib-index/mail-index-transaction-update.c	Tue Sep 14 17:55:25 2010 +0100
+++ b/src/lib-index/mail-index-transaction-update.c	Tue Sep 14 21:12:08 2010 +0100
@@ -143,7 +143,8 @@
 
 	/* @UNSAFE: move days forward and fill the missing days with old
 	   day_first_uid[0]. */
-	memmove(hdr.day_first_uid + days, hdr.day_first_uid, max_days - days);
+	memmove(hdr.day_first_uid + days, hdr.day_first_uid,
+		(max_days - days) * sizeof(hdr.day_first_uid[0]));
 	for (i = 1; i < days; i++)
 		hdr.day_first_uid[i] = hdr.day_first_uid[0];
 


More information about the dovecot-cvs mailing list