#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 code@…):

 None
 Filename mktime.patch could not be saved, problem: [Errno 13] Permission
 denied:
 
'/home/mutt/trac/files/attachments/ticket/4c0/4c0ca50acf1dba181d72e4ecfffaeb06d9ad64ac/ba05725e0e04acbcaee9b5e08b34c6aef4697a5e.patch'
 Filename untitled-part.sig could not be saved, problem: [Errno 13]
 Permission denied:
 
'/home/mutt/trac/files/attachments/ticket/4c0/4c0ca50acf1dba181d72e4ecfffaeb06d9ad64ac/90449eb29c8e1d56f09effe64f19fbf629d6557d.sig'\{{{
 I propose the attached patch instead, which greatly simplifies
 mutt_mktime by using the system mktime(), correctly returns (time_t)-1
 if the call to mktime() fails, and still does the local timezone
 calculation that the original mutt_mktime() did if it does not fail.

 I tested this with Vincent's attached mbox after configuring with

   ./configure CFLAGS="-O2 -fsanitize=undefined -fno-sanitize-recover -m32"

 It did not crash or abort, and displayed both messages properly.
 }}}

 [attachment:"mktime.patch"]

 [attachment:"untitled-part.sig"]

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

Reply via email to