#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 untitled-part.sig could not be saved, problem: [Errno 13]
Permission denied:
'/home/mutt/trac/files/attachments/ticket/4c0/4c0ca50acf1dba181d72e4ecfffaeb06d9ad64ac/90449eb29c8e1d56f09effe64f19fbf629d6557d.sig'\{{{
Well, so I did some research on this, and it turns out that portably
and reliably calculating the maximum value of an integer type is
actually impossible. In addition to CHAR_BIT, there's also the matter
of padding bits, and the fact that which bit is the sign bit is
implementation-specific. In that light, Vincent's macro is probably
sufficient...
However I actually think the right solution to this problem is to do
nothing. So what if the time_t overflows? Why complicate the code to
jump through hoops for this? Displaying an e-mail that has an invalid
date with an incorrect date seems like about all you could do
anyway--I can't currently get to dev.mutt.org to look at Vincent's
full patch, but I'm guessing that's all it does... but probably it
just choses a different wrong date to display.
But, so what? Just don't compile with the extra pedantic flags and
this doesn't really matter.
}}}
[attachment:"untitled-part.sig"]
--
Ticket URL: <https://dev.mutt.org/trac/ticket/3880#comment:10>
Mutt <http://www.mutt.org/>
The Mutt mail user agent