dovecot-2.0: lib-index: Added a missing sanity check for expunge...

dovecot at dovecot.org dovecot at dovecot.org
Thu Dec 2 06:37:41 EET 2010


details:   http://hg.dovecot.org/dovecot-2.0/rev/e12572ca4454
changeset: 12487:e12572ca4454
user:      Timo Sirainen <tss at iki.fi>
date:      Thu Dec 02 04:37:38 2010 +0000
description:
lib-index: Added a missing sanity check for expunge-guid record's uid.
This fixes a non-self healing assert-crash.

diffstat:

 src/lib-index/mail-index-sync-update.c |  9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diffs (20 lines):

diff -r d7886c6d9ba5 -r e12572ca4454 src/lib-index/mail-index-sync-update.c
--- a/src/lib-index/mail-index-sync-update.c	Tue Nov 30 22:38:05 2010 +0000
+++ b/src/lib-index/mail-index-sync-update.c	Thu Dec 02 04:37:38 2010 +0000
@@ -558,8 +558,15 @@
 			break;
 		}
 		end = CONST_PTR_OFFSET(data, hdr->size);
-		for (; rec != end; rec++)
+		for (; rec != end; rec++) {
+			if (rec->uid == 0) {
+				mail_index_sync_set_corrupted(ctx,
+					"Expunge-guid for invalid uid=%u",
+					rec->uid);
+				break;
+			}
 			sync_expunge(ctx, rec->uid, rec->uid);
+		}
 		break;
 	}
 	case MAIL_TRANSACTION_FLAG_UPDATE: {


More information about the dovecot-cvs mailing list