]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
sdbox: If sdbox header is corrupted, resize it to make sure its size is correct.
authorTimo Sirainen <tss@iki.fi>
Tue, 18 Jun 2013 15:54:20 +0000 (18:54 +0300)
committerTimo Sirainen <tss@iki.fi>
Tue, 18 Jun 2013 15:54:20 +0000 (18:54 +0300)
src/lib-storage/index/dbox-single/sdbox-storage.c

index 9ee0daa6f9502d9795ad1792a7cc8c4d13661758..63376c6104394c2e7989b46ce0b1db73612c5c25 100644 (file)
@@ -185,8 +185,10 @@ static void sdbox_update_header(struct sdbox_mailbox *mbox,
        struct sdbox_index_header hdr, new_hdr;
        bool need_resize;
 
-       if (sdbox_read_header(mbox, &hdr, TRUE, &need_resize) < 0)
+       if (sdbox_read_header(mbox, &hdr, TRUE, &need_resize) < 0) {
                memset(&hdr, 0, sizeof(hdr));
+               need_resize = TRUE;
+       }
 
        new_hdr = hdr;