[tz] Wrong behaviour with truncated TZif files

Almaz Mingaleev mingaleev at google.com
Mon May 23 11:48:20 UTC 2022


Hi Paul,
Fix works for issues I've mentioned.
However, I think overflow happens somewhere.
Please see the attached code.
I've run it in the same way as in the first message.

On my workstation it prints following:
sizeof time_t: 8
2120284800
-1
-218154496
-1


On Sun, 20 Feb 2022 at 21:32, Paul Eggert <eggert at cs.ucla.edu> wrote:

> On 2/17/22 05:09, Almaz Mingaleev via tz wrote:
>
> > With a truncated TZif file it prints 331344000. With non-truncated one it
> > prints 331372800.
> > The latter is the right answer.
>
> Thanks for reporting that. I installed the attached proposed patches;
> the first should fix it and the second updates a related comment.
>
> This seems to be my weekend for fixing mktime bugs, as I fixed one in
> glibc yesterday involving time in Indiana <https://bugs.gnu.org/48085>.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mm.icann.org/pipermail/tz/attachments/20220523/3859b40c/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mktime_test.cpp
Type: application/octet-stream
Size: 675 bytes
Desc: not available
URL: <https://mm.icann.org/pipermail/tz/attachments/20220523/3859b40c/mktime_test.cpp>


More information about the tz mailing list