dovecot: maildir_uidlist_set_ext() assert-crashed when trying to...

dovecot at dovecot.org dovecot at dovecot.org
Fri Dec 21 21:05:18 EET 2007


details:   http://hg.dovecot.org/dovecot/rev/7966e025ac0f
changeset: 7013:7966e025ac0f
user:      Timo Sirainen <tss at iki.fi>
date:      Fri Dec 21 21:05:14 2007 +0200
description:
maildir_uidlist_set_ext() assert-crashed when trying to set it to expunged
message or so new message that we hadn't yet refreshed uidlist since seeing
it.

diffstat:

1 file changed, 10 insertions(+), 1 deletion(-)
src/lib-storage/index/maildir/maildir-uidlist.c |   11 ++++++++++-

diffs (21 lines):

diff -r 2f25031c4a84 -r 7966e025ac0f src/lib-storage/index/maildir/maildir-uidlist.c
--- a/src/lib-storage/index/maildir/maildir-uidlist.c	Fri Dec 21 19:46:24 2007 +0200
+++ b/src/lib-storage/index/maildir/maildir-uidlist.c	Fri Dec 21 21:05:14 2007 +0200
@@ -837,7 +837,16 @@ maildir_uidlist_set_ext_real(struct mail
 	unsigned int len;
 
 	rec = maildir_uidlist_lookup_rec(uidlist, uid, &idx);
-	i_assert(rec != NULL);
+	if (rec == NULL) {
+		/* maybe it's a new message */
+		if (maildir_uidlist_refresh(uidlist) < 0)
+			return;
+		rec = maildir_uidlist_lookup_rec(uidlist, uid, &idx);
+		if (rec == NULL) {
+			/* message is already expunged, ignore */
+			return;
+		}
+	}
 
 	buf = buffer_create_dynamic(pool_datastack_create(), 128);
 


More information about the dovecot-cvs mailing list