changeset 5584:13cfb82736d7 HEAD

Make sure uid_validity and next_uid aren't 0 in the uidlist header.
author Timo Sirainen <tss@iki.fi>
date Wed, 09 May 2007 16:12:13 +0300
parents 790dec1815e0
children e33158bc72b0
files src/lib-storage/index/maildir/maildir-uidlist.c
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-storage/index/maildir/maildir-uidlist.c	Wed May 09 11:58:53 2007 +0300
+++ b/src/lib-storage/index/maildir/maildir-uidlist.c	Wed May 09 16:12:13 2007 +0300
@@ -347,6 +347,11 @@
 			"%s: next_uid was lowered (%u -> %u)",
 			uidlist->fname, uidlist->next_uid, next_uid);
 		ret = 0;
+	} else if (uid_validity == 0 || next_uid == 0) {
+                mail_storage_set_critical(storage,
+			"%s: Broken header (uidvalidity = %u, next_uid=%u)",
+			uidlist->fname, uid_validity, next_uid);
+		ret = 0;
 	} else {
 		uidlist->uid_validity = uid_validity;
 		uidlist->next_uid = next_uid;