From 42dbf21a56ef885bbe9fbd0c3ced8cf6b106c2c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Honza=20Hor=C3=A1k?= Date: Wed, 29 Jun 2011 10:12:36 +0200 Subject: [PATCH] Fixed message indexes when skipping fetch response (mutt bug #3288) --- mutt-1.5.21-hdrcnt.patch | 26 ++++++++++++++++++++++++-- mutt.spec | 5 ++++- 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/mutt-1.5.21-hdrcnt.patch b/mutt-1.5.21-hdrcnt.patch index c96b817..26bec5e 100644 --- a/mutt-1.5.21-hdrcnt.patch +++ b/mutt-1.5.21-hdrcnt.patch @@ -1,6 +1,6 @@ diff -up mutt-1.5.21/imap/message.c.hdrcnt mutt-1.5.21/imap/message.c --- mutt-1.5.21/imap/message.c.hdrcnt 2010-08-24 18:34:21.000000000 +0200 -+++ mutt-1.5.21/imap/message.c 2011-04-01 15:23:14.254360560 +0200 ++++ mutt-1.5.21/imap/message.c 2011-06-13 15:44:08.268380854 +0200 @@ -65,7 +65,7 @@ int imap_read_headers (IMAP_DATA* idata, char *hdrreq = NULL; FILE *fp; @@ -19,7 +19,15 @@ diff -up mutt-1.5.21/imap/message.c.hdrcnt mutt-1.5.21/imap/message.c ctx->hdrs[idx] = imap_hcache_get (idata, h.data->uid); if (ctx->hdrs[idx]) { -@@ -273,13 +273,14 @@ int imap_read_headers (IMAP_DATA* idata, +@@ -211,6 +211,7 @@ int imap_read_headers (IMAP_DATA* idata, + dprint (3, (debugfile, "bad cache entry at %d, giving up\n", h.sid - 1)); + imap_free_header_data((void**) (void*) &h.data); + evalhc = 0; ++ idx--; + } + } + while (rc != IMAP_CMD_OK && mfhrc == -1); +@@ -273,18 +274,20 @@ int imap_read_headers (IMAP_DATA* idata, { dprint (2, (debugfile, "msg_fetch_header: ignoring fetch response with no body\n")); mfhrc = -1; @@ -35,3 +43,17 @@ diff -up mutt-1.5.21/imap/message.c.hdrcnt mutt-1.5.21/imap/message.c if (idx > msgend) { dprint (1, (debugfile, "imap_read_headers: skipping FETCH response for " + "unknown message number %d\n", h.sid)); + mfhrc = -1; ++ idx--; + continue; + } + /* May receive FLAGS updates in a separate untagged response (#2935) */ +@@ -292,6 +295,7 @@ int imap_read_headers (IMAP_DATA* idata, + { + dprint (2, (debugfile, "imap_read_headers: message %d is not new\n", + h.sid)); ++ idx--; + continue; + } + diff --git a/mutt.spec b/mutt.spec index 30d59ee..ff16417 100644 --- a/mutt.spec +++ b/mutt.spec @@ -16,7 +16,7 @@ Summary: A text mode mail user agent Name: mutt Version: 1.5.21 -Release: 5%{?dist} +Release: 6%{?dist} Epoch: 5 # The entire source code is GPLv2+ except # pgpewrap.c setenv.c sha1.c wcwidth.c which are Public Domain @@ -154,6 +154,9 @@ rm -rf $RPM_BUILD_ROOT %{_mandir}/man5/muttrc.* %changelog +* Wed Jun 29 2011 Honza Horak - 5:1.5.21-6 +- Fixed message indexes when skipping fetch response (mutt bug #3288) + * Fri Apr 15 2011 Honza Horak - 5:1.5.21-5 - Fixed hostname verification of x.509 certificates. (rhbz#688756, CVE-2011-1429)