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

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