From 1127f3e1ad7135b6ee5d5e13f8fd1e72f85a76f8 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Tue, 18 Jun 2013 18:54:20 +0300 Subject: [PATCH] sdbox: If sdbox header is corrupted, resize it to make sure its size is correct. --- src/lib-storage/index/dbox-single/sdbox-storage.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lib-storage/index/dbox-single/sdbox-storage.c b/src/lib-storage/index/dbox-single/sdbox-storage.c index 9ee0daa6f9..63376c6104 100644 --- a/src/lib-storage/index/dbox-single/sdbox-storage.c +++ b/src/lib-storage/index/dbox-single/sdbox-storage.c @@ -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; -- 2.47.3