]> granicus.if.org Git - neomutt/commitdiff
Reset invalid parsed received dates to 0. (closes #3878)
authorKevin McCarthy <kevin@8t8.us>
Sun, 25 Sep 2016 20:11:03 +0000 (13:11 -0700)
committerRichard Russon <rich@flatcap.org>
Sun, 2 Oct 2016 14:53:37 +0000 (15:53 +0100)
The actual problem in the ticket would be solved by d3f31cf9239e (see
#3798).  However there is still the bug that Mutt considers a
(hdr->received != 0) to be set and usable, despite not checking the
return value of mutt_parse_date().

Change mutt_read_rfc822_header() to unset an invalid received value
back to 0.  We don't do this inside mutt_read_rfc822_line() because
that would cause the next received line to be parsed.

parse.c

diff --git a/parse.c b/parse.c
index 8a7ccd18d41fe4294d146a5e1212740d9ec7c0a3..c75a8b1a63801346532243713e66f913d2a93fe3 100644 (file)
--- a/parse.c
+++ b/parse.c
@@ -1567,6 +1567,12 @@ ENVELOPE *mutt_read_rfc822_header (FILE *f, HEADER *hdr, short user_hdrs,
        e->real_subj = e->subject;
     }
 
+    if (hdr->received < 0)
+    {
+      dprint(1,(debugfile,"read_rfc822_header(): resetting invalid received time to 0\n"));
+      hdr->received = 0;
+    }
+
     /* check for missing or invalid date */
     if (hdr->date_sent <= 0)
     {