#3880: integer overflow in date.c (mutt_mktime)
-----------------------+----------------------
  Reporter:  vinc17    |      Owner:  mutt-dev
      Type:  defect    |     Status:  new
  Priority:  critical  |  Milestone:
 Component:  mutt      |    Version:  1.7.0
Resolution:            |   Keywords:
-----------------------+----------------------

Comment (by tamo):

 Although 32bit time_t is not a problem of mutt but of the system
 (https://en.wikipedia.org/wiki/Year_2038_problem),
 mutt should somehow limit the value (to the year 292,277,026,596 ?), e.g.
 {{{
 /* theoretically time_t can be float but it is integer on most (if not
 all) systems */
 #define TIME_T_MAX (time_t)((1UL << ((sizeof(time_t) << 3) - 1)) - 1)
 #define TM_YEAR_MAX (1970 + (((((TIME_T_MAX - 59) / 60) - 59) / 60) - 23)
 / 24 / 366)

 if(t->tm_year > TM_YEAR_MAX)
   return TIME_T_MAX;
 }}}
 Yes, spammers might use such futuristic dates in order to show their
 messages on top of the mailbox.

--
Ticket URL: <https://dev.mutt.org/trac/ticket/3880#comment:2>
Mutt <http://www.mutt.org/>
The Mutt mail user agent

Reply via email to