From ccfc98f0cf18c1c64c4c524cfcc49bc1f4d6ec94 Mon Sep 17 00:00:00 2001 From: Richard Russon Date: Thu, 19 Sep 2019 16:03:35 +0100 Subject: [PATCH] reduce timestamp limits The two tests were only applicable on 32-bit architectures. --- mutt/date.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mutt/date.c b/mutt/date.c index bf53aeabd..8fe6aca96 100644 --- a/mutt/date.c +++ b/mutt/date.c @@ -230,10 +230,10 @@ time_t mutt_date_make_time(struct tm *t, bool local) 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, }; - /* Prevent an integer overflow. */ - if ((time_t) t->tm_year > (TM_YEAR_MAX - 1900)) + /* Prevent an integer overflow, with some arbitrary limits. */ + if (t->tm_year > 10000) return TIME_T_MAX; - if ((time_t) t->tm_year < (TM_YEAR_MIN - 1900)) + if (t->tm_year < -10000) return TIME_T_MIN; if ((t->tm_mday < 1) || (t->tm_mday > 31)) -- 2.40.0