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

dovecot at dovecot.org dovecot at dovecot.org
Thu Dec 2 06:39:21 EET 2010


details:   http://hg.dovecot.org/dovecot-1.2/rev/c447114b0f89
changeset: 9633:c447114b0f89
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 84a1deb21c2e -r c447114b0f89 src/lib-index/mail-index-sync-update.c
--- a/src/lib-index/mail-index-sync-update.c	Fri Nov 26 18:51:47 2010 +0000
+++ b/src/lib-index/mail-index-sync-update.c	Thu Dec 02 04:37:38 2010 +0000
@@ -528,8 +528,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