dovecot: When rewriting a directory, make sure the write buffers...

dovecot at dovecot.org dovecot at dovecot.org
Thu Jul 19 02:56:46 EEST 2007


details:   http://hg.dovecot.org/dovecot/rev/7639a6df4acb
changeset: 6088:7639a6df4acb
user:      Timo Sirainen <tss at iki.fi>
date:      Thu Jul 19 02:13:44 2007 +0300
description:
When rewriting a directory, make sure the write buffers are zeroed before
doing anything.

diffstat:

1 file changed, 2 insertions(+), 1 deletion(-)
src/lib-index/mailbox-list-index-sync.c |    3 ++-

diffs (20 lines):

diff -r f479a774a416 -r 7639a6df4acb src/lib-index/mailbox-list-index-sync.c
--- a/src/lib-index/mailbox-list-index-sync.c	Thu Jul 19 01:57:47 2007 +0300
+++ b/src/lib-index/mailbox-list-index-sync.c	Thu Jul 19 02:13:44 2007 +0300
@@ -501,7 +501,7 @@ mailbox_list_index_sync_alloc_space(stru
 
 	if (ctx->index->mmap_disable) {
 		/* write the data into temporary buffer first */
-		buffer_set_used_size(ctx->output_buf, 0);
+		buffer_reset(ctx->output_buf);
 
 		if (ctx->output->offset != pos) {
 			i_assert(pos > ctx->output->offset &&
@@ -520,6 +520,7 @@ mailbox_list_index_sync_alloc_space(stru
 			i_assert(pos + size < ctx->index->mmap_size);
 		}
 		*base_r = PTR_OFFSET(ctx->index->mmap_base, pos);
+		memset(*base_r, 0, size);
 	}
 
 	*base_offset_r = pos;


More information about the dovecot-cvs mailing list