]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
dbox: Fixed crash on creation of a new mailbox.
authorTimo Sirainen <tss@iki.fi>
Wed, 16 Mar 2011 16:40:40 +0000 (18:40 +0200)
committerTimo Sirainen <tss@iki.fi>
Wed, 16 Mar 2011 16:40:40 +0000 (18:40 +0200)
Broken by recent changes.

src/lib-storage/index/dbox-multi/mdbox-storage.c
src/lib-storage/index/dbox-single/sdbox-storage.c

index a0f4a114c61377aba96f4317d8611f655cdba0ee..0ce4e64a86ed92cf579a6ca91f6022fe73b31881 100644 (file)
@@ -225,7 +225,7 @@ static int mdbox_write_index_header(struct mailbox *box,
                        offsetof(struct mail_index_header, next_uid),
                        &uid_next, sizeof(uid_next), TRUE);
        }
-       if (update->min_first_recent_uid != 0 &&
+       if (update != NULL && update->min_first_recent_uid != 0 &&
            hdr->first_recent_uid < update->min_first_recent_uid) {
                uint32_t first_recent_uid = update->min_first_recent_uid;
 
index a4c035b198e2b486e6cfef9d2acdeeb788e509f5..576fd7fd1cd6ccf65cf6576f56a5d9e85460e21f 100644 (file)
@@ -159,7 +159,7 @@ static int sdbox_mailbox_create_indexes(struct mailbox *box,
                        offsetof(struct mail_index_header, next_uid),
                        &uid_next, sizeof(uid_next), TRUE);
        }
-       if (update->min_first_recent_uid != 0 &&
+       if (update != NULL && update->min_first_recent_uid != 0 &&
            hdr->first_recent_uid < update->min_first_recent_uid) {
                uint32_t first_recent_uid = update->min_first_recent_uid;