Blame SOURCES/cyrus-imapd-squatter-assert-crash.patch

64e822
diff --git a/imap/squatter.c b/imap/squatter.c
64e822
index 4419379..d00f003 100644
64e822
--- a/imap/squatter.c
64e822
+++ b/imap/squatter.c
64e822
@@ -408,8 +408,13 @@ static void expand_mboxnames(strarray_t *sa, int nmboxnames,
64e822
         else {
64e822
             /* Translate any separators in mailboxname */
64e822
             char *intname = mboxname_from_external(mboxnames[i], &squat_namespace, NULL);
64e822
-            int flags = recursive_flag ? 0 : MBOXTREE_SKIP_CHILDREN;
64e822
-            mboxlist_mboxtree(intname, addmbox, sa, flags);
64e822
+            if (!intname || *intname == '\0') {
64e822
+                fprintf(stderr, "Mailbox %s: %s\n",
64e822
+                        mboxnames[i], error_message(IMAP_MAILBOX_BADNAME));
64e822
+            } else {
64e822
+                int flags = recursive_flag ? 0 : MBOXTREE_SKIP_CHILDREN;
64e822
+                mboxlist_mboxtree(intname, addmbox, sa, flags);
64e822
+            }
64e822
             free(intname);
64e822
         }
64e822