#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 kevin8t8):

 This was actually due to the
 {{{
   g += (t->tm_year - 70) * 365;
 }}}
 line, because the intermediate multiplication was using ints.  Adding a
 (time_t) cast to the 365 stops the overflow.

 That said, I need a year bigger than an int to actually trigger the
 TM_YEAR_MAX on my platform, which isn't gonna happen using struct tm.

 So I'll post a patch shortly for review and will count on you all to say
 something if I got it wrong.  :-)

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

Reply via email to