changeset 19982:4e015dc7bbf2

lib-storage: FS layout assert-crashed when trying to list with invalid UTF8 pattern
author Timo Sirainen <timo.sirainen@dovecot.fi>
date Mon, 04 Apr 2016 12:22:06 +0300
parents ec835c27c248
children 1626b756a2a6
files src/lib-storage/list/mailbox-list-fs-iter.c
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-storage/list/mailbox-list-fs-iter.c	Mon Apr 04 11:11:13 2016 +0300
+++ b/src/lib-storage/list/mailbox-list-fs-iter.c	Mon Apr 04 12:22:06 2016 +0300
@@ -350,6 +350,10 @@
 		   validation. */
 		if (strncmp(test_pattern, _list->ns->prefix, prefix_len) == 0)
 			test_pattern += prefix_len;
+		if (!uni_utf8_str_is_valid(test_pattern)) {
+			/* ignore invalid UTF8 patterns */
+			continue;
+		}
 		/* check pattern also when it's converted to use real
 		   separators. */
 		real_pattern =