]> granicus.if.org Git - neomutt/commitdiff
Fix uninitialized prompt buffer in imap_mailbox_rename(). (closes #3819)
authorKevin McCarthy <kevin@8t8.us>
Wed, 23 Mar 2016 21:20:43 +0000 (14:20 -0700)
committerKevin McCarthy <kevin@8t8.us>
Wed, 23 Mar 2016 21:20:43 +0000 (14:20 -0700)
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.

imap/browse.c

index 59e90891dc7a9dd00f8f1664c4e552594becec48..c3ea2f7144aaa026d9834d44f92f20bceff8884c 100644 (file)
@@ -320,6 +320,7 @@ int imap_mailbox_rename(const char* mailbox)
   }
 
   snprintf(buf, sizeof (buf), _("Rename mailbox %s to: "), mx.mbox);
+  strfcpy (newname, NONULL (mx.mbox), sizeof (newname));
   
  if (mutt_get_field (buf, newname, sizeof (newname), M_FILE) < 0)
     goto fail;