[tz] Wrong behaviour with truncated TZif files

Almaz Mingaleev mingaleev at google.com
Thu May 26 18:23:41 UTC 2022


Somewhat related to truncation:
settzname function [1] calls update_tzname_etc with all time types and
all transitions. Shouldn't it be called only for specified local time only
i.e.
where ttunspecified(sp, ...) returns false?

Setting any value of tzname [2] to "-00" does not look meaningful.

Do I miss anything here?

Thanks,
Almaz

[1]
https://github.com/eggert/tz/blob/9fa1a5395f48fc5d563af1f58d6a8b787c27de78/localtime.c#L296

[2]
https://github.com/eggert/tz/blob/9fa1a5395f48fc5d563af1f58d6a8b787c27de78/private.h#L545

On Tue, 24 May 2022 at 09:53, Almaz Mingaleev <mingaleev at google.com> wrote:

> Yep, that was the problem. Thanks!
>
> On Mon, 23 May 2022 at 19:14, Paul Eggert <eggert at cs.ucla.edu> wrote:
>
>> On 5/23/22 04:48, Almaz Mingaleev wrote:
>> > I think overflow happens somewhere.
>> > Please see the attached code.
>>
>> That test doesn't look right, as each mktime call modifies its argument,
>> polluting the next test case. Please try the attached test instead,
>> ported to C. On my platform (Ubuntu 22.04, x86-64) this outputs:
>>
>> sizeof time_t: 8
>> 2120284800
>> 2120256000
>> 4076812800 <(407)%20681-2800>
>> 4076784000 <(407)%20678-4000>
>>
>> which looks OK.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mm.icann.org/pipermail/tz/attachments/20220526/ef14a1d4/attachment.htm>


More information about the tz mailing list