changeset: 6594:27cde0a2fe32
user:      Kevin McCarthy <ke...@8t8.us>
date:      Wed Mar 23 14:20:43 2016 -0700
link:      http://dev.mutt.org/hg/mutt/rev/27cde0a2fe32

Fix uninitialized prompt buffer in imap_mailbox_rename(). (closes #3819)

This is a patch from OpenBSD to initialize the newname buffer in
imap_mailbox_rename().  Previously it would generate random garbage in
the prompt.

This version of the patch initializes the prompt to the old mailbox name.

Thanks to TAKAHASHI Tamotsu for finding this patch.

changeset: 6595:55a389b96d0b
user:      Kevin McCarthy <ke...@8t8.us>
date:      Wed Mar 23 15:28:25 2016 -0700
link:      http://dev.mutt.org/hg/mutt/rev/55a389b96d0b

Prevent renaming root folder in imap.

The root folder results in mx.mbox being NULL, which causes a
segfault.  This can be triggered by entering a subfolder and trying to
rename the ".." entry.

Due to the translation string freeze, no visible error message is
displayed.  Add a TODO note about this for post-1.6 release.

diffs (20 lines):

diff -r 789500dae762 -r 55a389b96d0b imap/browse.c
--- a/imap/browse.c     Wed Mar 23 13:17:55 2016 -0700
+++ b/imap/browse.c     Wed Mar 23 15:28:25 2016 -0700
@@ -319,7 +319,16 @@
     goto fail;
   }
 
+  /* TODO: add mutt_error call, such as
+   * "Cannot rename root folder"
+   */
+  if (!mx.mbox)
+  {
+    goto fail;
+  }
+
   snprintf(buf, sizeof (buf), _("Rename mailbox %s to: "), mx.mbox);
+  strfcpy (newname, mx.mbox, sizeof (newname));
   
  if (mutt_get_field (buf, newname, sizeof (newname), M_FILE) < 0)
     goto fail;

Reply via email to