#3990: segfault in hdr_format_str
--------------------------+----------------------
  Reporter:  josephbisch  |      Owner:  mutt-dev
      Type:  defect       |     Status:  new
  Priority:  major        |  Milestone:
 Component:  mutt         |    Version:
Resolution:               |   Keywords:
--------------------------+----------------------

Comment (by kevin8t8):

 One fix would be to add an additional range check in mutt_mktime() below
 the TM_YEAR_MAX check.  Something like:

 {{{
   /* 64-bit platforms can theoretically hold a very large year, but other
 system
    * calls such as strftime() and gmtime() error out on large year values.
    * Cap the value at year 9999.
    */
   if (t->tm_year > 9999-1900)
     t->tm_year = 9999-1900;
 }}}

 I think the TM_YEAR_MAX check is still needed for 32-bit time_t platforms,
 so this would be in addition.

 I believe this would also "fix" #3989 although I think we should still add
 a NULL check there for correctness.

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

Reply via email to