From: Kevin McCarthy Date: Sun, 25 Sep 2016 20:11:03 +0000 (-0700) Subject: Reset invalid parsed received dates to 0. (closes #3878) X-Git-Tag: mutt-1-7-1-rel~2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c160ca1d74915f7b6a2fa18a5f4bdfc1663b7c88;p=mutt Reset invalid parsed received dates to 0. (closes #3878) 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. --- diff --git a/parse.c b/parse.c index 92cfeb0f..0ae55940 100644 --- a/parse.c +++ b/parse.c @@ -1455,6 +1455,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) {