From: Brendan Cully Date: Tue, 3 Apr 2007 00:56:16 +0000 (-0700) Subject: Fix off-by-one allocating mh sequences X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cd960be4509b40aae9b88c4bd3a0c09d856a164e;p=neomutt Fix off-by-one allocating mh sequences --- diff --git a/ChangeLog b/ChangeLog index 2cc25ca62..a8f488957 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,10 @@ -2007-04-02 14:33 -0700 Brendan Cully (eabef30c9344) +2007-04-02 17:15 -0700 Brendan Cully (527589b0b7dd) + + * curs_lib.c: Make mutt_edit_file display error if editor return is + non-zero. (closes #1638) + + * imap/command.c: Reset uidnext unconditionally in IMAP new mail + check. Reverts a logic error introduced in [0cb476dc70a7] * imap/imap.c, imap/imap_private.h, imap/message.c, imap/util.c: Fix a segfault in the new mboxcache hcache lookup. idata may not have an diff --git a/mh.c b/mh.c index 55ae0abce..4026c7a58 100644 --- a/mh.c +++ b/mh.c @@ -98,9 +98,10 @@ static void mhs_alloc (struct mh_sequences *mhs, int i) if (i > mhs->max || !mhs->flags) { newmax = i + 128; + j = mhs->flags ? mhs->max + 1 : 0; safe_realloc (&mhs->flags, sizeof (mhs->flags[0]) * (newmax + 1)); - for (j = mhs->max + 1; j <= newmax; j++) - mhs->flags[j] = 0; + while (j <= newmax) + mhs->flags[j++] = 0; mhs->max = newmax; }