Fixed message indexes when skipping fetch response (mutt bug #3288)

This commit is contained in:
Honza Horák 2011-06-29 10:12:36 +02:00
parent a5d2d9c94b
commit 42dbf21a56
2 changed files with 28 additions and 3 deletions

View File

@ -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;
}

View File

@ -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 <hhorak@redhat.com> - 5:1.5.21-6
- Fixed message indexes when skipping fetch response (mutt bug #3288)
* Fri Apr 15 2011 Honza Horak <hhorak@redhat.com> - 5:1.5.21-5
- Fixed hostname verification of x.509 certificates.
(rhbz#688756, CVE-2011-1429)