This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author remi.lapeyre
Recipients remi.lapeyre
Date 2020-05-21.13:47:59
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1590068879.49.0.231802096396.issue40713@roundup.psfhosted.org>
In-reply-to
Content
Here's the warning given by clang:


/Users/remi/src/cpython/Modules/_zoneinfo.c:1487:9: warning: variable 'dst_offset' is used uninitialized whenever 'if'
      condition is true [-Wsometimes-uninitialized]
    if (*p == '\0') {
        ^~~~~~~~~~
/Users/remi/src/cpython/Modules/_zoneinfo.c:1544:50: note: uninitialized use occurs here
    build_tzrule(std_abbr, dst_abbr, std_offset, dst_offset, start, end, out);
                                                 ^~~~~~~~~~
/Users/remi/src/cpython/Modules/_zoneinfo.c:1487:5: note: remove the 'if' if its condition is always false
    if (*p == '\0') {
    ^~~~~~~~~~~~~~~~~
/Users/remi/src/cpython/Modules/_zoneinfo.c:1460:32: note: initialize the variable 'dst_offset' to silence this warning
    long std_offset, dst_offset;
                               ^
                                = 0
/Users/remi/src/cpython/Modules/_zoneinfo.c:1910:19: warning: suggest braces around initialization of subobject
      [-Wmissing-braces]
    _tzrule rv = {0};
                  ^
                  {}

Looking at the code path, the unitialized dst_offset may create a ZoneInfo with a garbage value in dstoff with some inputs so this should be backported to Python3.9 too.
History
Date User Action Args
2020-05-21 13:47:59remi.lapeyresetrecipients: + remi.lapeyre
2020-05-21 13:47:59remi.lapeyresetmessageid: <1590068879.49.0.231802096396.issue40713@roundup.psfhosted.org>
2020-05-21 13:47:59remi.lapeyrelinkissue40713 messages
2020-05-21 13:47:59remi.lapeyrecreate