]> granicus.if.org Git - neomutt/commitdiff
Avoid reading past actual headers when reopening mailboxes. From
authorThomas Roessler <roessler@does-not-exist.org>
Mon, 22 Feb 1999 11:10:14 +0000 (11:10 +0000)
committerThomas Roessler <roessler@does-not-exist.org>
Mon, 22 Feb 1999 11:10:14 +0000 (11:10 +0000)
Daniel Eisenbud.

imap.c
mbox.c

diff --git a/imap.c b/imap.c
index e89200c4182cd21b44b25f8575f547982714439a..9bd532edbd14f397c99deb79e5e3a0360fa4b4f3 100644 (file)
--- a/imap.c
+++ b/imap.c
@@ -760,7 +760,7 @@ static int imap_reopen_mailbox (CONTEXT *ctx, int *index_hint)
       }
       if (!found)
       {
-       for (j = 0; j < i; j++)
+       for (j = 0; j < i && j < old_msgcount; j++)
        {
          if (old_hdrs[j] == NULL)
            continue;
diff --git a/mbox.c b/mbox.c
index 752803b9ab352a660bfbffa9989540ee9c227229..175b24a75058dc485fa90f54da88e8f24745c40c 100644 (file)
--- a/mbox.c
+++ b/mbox.c
@@ -1107,7 +1107,7 @@ int mutt_reopen_mailbox (CONTEXT *ctx, int *index_hint)
       }
       if (!found)
       {
-       for (j = 0; j < i; j++)
+       for (j = 0; j < i && j < old_msgcount; j++)
        {
          if (old_hdrs[j] == NULL)
            continue;