]> granicus.if.org Git - neomutt/commitdiff
reduce timestamp limits
authorRichard Russon <rich@flatcap.org>
Thu, 19 Sep 2019 15:03:35 +0000 (16:03 +0100)
committerRichard Russon <rich@flatcap.org>
Thu, 19 Sep 2019 15:27:00 +0000 (16:27 +0100)
The two tests were only applicable on 32-bit architectures.

mutt/date.c

index bf53aeabdda1d1d72b5e46ce569031c1e4110e09..8fe6aca96e90b465200369771d21fa794a99cbef 100644 (file)
@@ -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))