dovecot-1.1: dbox: Crashfix when using old maildir files.

dovecot at dovecot.org dovecot at dovecot.org
Mon Jun 2 18:51:08 EEST 2008


details:   http://hg.dovecot.org/dovecot-1.1/rev/ffa9c0dc27a7
changeset: 7588:ffa9c0dc27a7
user:      Timo Sirainen <tss at iki.fi>
date:      Mon Jun 02 18:51:02 2008 +0300
description:
dbox: Crashfix when using old maildir files.

diffstat:

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

diffs (20 lines):

diff -r 0fad9c4d0146 -r ffa9c0dc27a7 src/lib-storage/index/maildir/maildir-uidlist.c
--- a/src/lib-storage/index/maildir/maildir-uidlist.c	Mon Jun 02 18:25:15 2008 +0300
+++ b/src/lib-storage/index/maildir/maildir-uidlist.c	Mon Jun 02 18:51:02 2008 +0300
@@ -315,8 +315,14 @@ static void maildir_uidlist_update_hdr(s
 static void maildir_uidlist_update_hdr(struct maildir_uidlist *uidlist,
 				       const struct stat *st)
 {
-	struct maildir_index_header *mhdr = &uidlist->mbox->maildir_hdr;
-
+	struct maildir_index_header *mhdr;
+
+	if (uidlist->mbox == NULL) {
+		/* dbox is using this */
+		return;
+	}
+
+	mhdr = &uidlist->mbox->maildir_hdr;
 	mhdr->uidlist_mtime = st->st_mtime;
 	mhdr->uidlist_mtime_nsecs = ST_MTIME_NSEC(*st);
 	mhdr->uidlist_size = st->st_size;


More information about the dovecot-cvs mailing list