[tz] tzcode2021e: uninitialized variable in localtime.c

Paul Eggert eggert at cs.ucla.edu
Tue Oct 26 22:11:56 UTC 2021


On 10/22/21 07:49, Christos Zoulas wrote:

> My linter reports "prevcorr" is uninitialized in the if statement
> below the comment that starts "To avoid other botches".

Thanks for mentioning that. This prompted me to find an obscure bug in 
localtime that would cause it to access an uninitialized local variable 
(which is undefined behavior) in cases involving 32-bit time_t code 
reading malformed 64-bit data. I installed the attached patch to fix the 
bug, and I hope this also pacifies your linter.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Fix-uninitialized-variable-bug.patch
Type: text/x-patch
Size: 2762 bytes
Desc: not available
URL: <https://mm.icann.org/pipermail/tz/attachments/20211026/0823744c/0001-Fix-uninitialized-variable-bug.patch>


More information about the tz mailing list