dovecot-1.2: Added assert.

dovecot at dovecot.org dovecot at dovecot.org
Tue Jun 17 15:31:11 EEST 2008


details:   http://hg.dovecot.org/dovecot-1.2/rev/ab08272053c5
changeset: 7882:ab08272053c5
user:      Timo Sirainen <tss at iki.fi>
date:      Tue Jun 17 14:00:28 2008 +0300
description:
Added assert.

diffstat:

1 file changed, 4 insertions(+), 2 deletions(-)
src/lib-index/mail-index-sync-update.c |    6 ++++--

diffs (23 lines):

diff -r b8262c3a36f3 -r ab08272053c5 src/lib-index/mail-index-sync-update.c
--- a/src/lib-index/mail-index-sync-update.c	Tue Jun 17 13:59:47 2008 +0300
+++ b/src/lib-index/mail-index-sync-update.c	Tue Jun 17 14:00:28 2008 +0300
@@ -284,6 +284,7 @@ static int sync_append(const struct mail
 {
 	struct mail_index_view *view = ctx->view;
 	struct mail_index_map *map = view->map;
+	const struct mail_index_record *old_rec;
 	enum mail_flags new_flags;
 	void *dest;
 	size_t append_pos;
@@ -306,8 +307,9 @@ static int sync_append(const struct mail
 		/* the flags may have changed since it was added to map.
 		   use the updated flags already, so flag counters won't get
 		   broken. */
-		new_flags =
-			MAIL_INDEX_MAP_IDX(map, map->hdr.messages_count)->flags;
+		old_rec = MAIL_INDEX_MAP_IDX(map, map->hdr.messages_count);
+		i_assert(old_rec->uid == rec->uid);
+		new_flags = old_rec->flags;
 	} else {
 		/* don't rely on buffer->used being at the correct position.
 		   at least expunges can move it */


More information about the dovecot-cvs mailing list