From: Kevin McCarthy Date: Wed, 23 Mar 2016 21:20:43 +0000 (-0700) Subject: Fix uninitialized prompt buffer in imap_mailbox_rename(). (closes #3819) X-Git-Tag: neomutt-20160404~34 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=92e2d9c12848d5a903e5ac0f48ad7122a2a437f0;p=neomutt 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. --- diff --git a/imap/browse.c b/imap/browse.c index 59e90891d..c3ea2f714 100644 --- a/imap/browse.c +++ b/imap/browse.c @@ -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;