dovecot-2.2: imapc: Don't assert-crash when trying to access ima...

dovecot at dovecot.org dovecot at dovecot.org
Sat Jun 1 03:06:59 EEST 2013


details:   http://hg.dovecot.org/dovecot-2.2/rev/cd314aa81805
changeset: 16439:cd314aa81805
user:      Timo Sirainen <tss at iki.fi>
date:      Sat Jun 01 03:06:54 2013 +0300
description:
imapc: Don't assert-crash when trying to access imapc_list_prefix itself.

diffstat:

 src/lib-storage/index/imapc/imapc-list.c |  11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diffs (21 lines):

diff -r 3ed452837a8d -r cd314aa81805 src/lib-storage/index/imapc/imapc-list.c
--- a/src/lib-storage/index/imapc/imapc-list.c	Sat Jun 01 02:56:57 2013 +0300
+++ b/src/lib-storage/index/imapc/imapc-list.c	Sat Jun 01 03:06:54 2013 +0300
@@ -225,9 +225,14 @@
 		/* ACL plugin does these lookups */
 	} else if (*prefix != '\0' && strcasecmp(storage_name, "INBOX") != 0) {
 		prefix_len = strlen(prefix);
-		i_assert(strncmp(prefix, storage_name, prefix_len) == 0 &&
-			 storage_name[prefix_len] == list->sep);
-		storage_name += prefix_len+1;
+		i_assert(strncmp(prefix, storage_name, prefix_len) == 0);
+		storage_name += prefix_len;
+		if (storage_name[0] == '\0') {
+			/* we're looking up the prefix itself */
+		} else {
+			i_assert(storage_name[0] == list->sep);
+			storage_name++;
+		}
 	}
 	return mailbox_list_default_get_vname(_list, storage_name);
 }


More information about the dovecot-cvs mailing list