]> granicus.if.org Git - neomutt/commitdiff
Fix off-by-one allocating mh sequences
authorBrendan Cully <brendan@kublai.com>
Tue, 3 Apr 2007 00:56:16 +0000 (17:56 -0700)
committerBrendan Cully <brendan@kublai.com>
Tue, 3 Apr 2007 00:56:16 +0000 (17:56 -0700)
ChangeLog
mh.c

index 2cc25ca6271e6c8619e43bb2126d6b71940c6dbd..a8f4889579ba290e529c905aa5c2ac8f88f7bda9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,10 @@
-2007-04-02 14:33 -0700  Brendan Cully  <brendan@kublai.com>  (eabef30c9344)
+2007-04-02 17:15 -0700  Brendan Cully  <brendan@kublai.com>  (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 55ae0abcea50f96e675078bf40cf7c271ca3928c..4026c7a582c4c978b9ecdb1ff7800ee628205294 100644 (file)
--- 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;
   }