<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p><font face="monospace">That is effectively the same.</font></p>
    <p><font face="monospace">But I would rather if Paul Eggert fixed
        the code.</font></p>
    <p><font face="monospace">When I diff localtime.c from 2023c release
        with the current github version, there<br>
        are changes which are obscure to me. </font></p>
    <p><font face="monospace">The use of union to save memory is
        dangerous, in my opinion. There is no need in today's machines
        to save a few kilobytes of RAM for a process.<br>
        Not even in embedded software for watches.<br>
        It makes the code obscure.<br>
      </font></p>
    <p><font face="monospace">I have the gut feeling that the bug is in
        the line sp->goahead = ts->goahead;</font></p>
    <p><font face="monospace">where ts has inherited old data from a
        previous call.</font></p>
    <p><font face="monospace"><br>
      </font></p>
    <div class="moz-cite-prefix">On 24.11.23 16:54, Carlo wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAMLunXSEuzOU_OcQ1CskqfvZdSbZGhnwPQ0QWYr+VJt5eQQZgg@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">
        <div>Dear Alois</div>
        <div><br>
        </div>
        <div><br>
        </div>
        <div>Have you tried using this, letting the compiler perform the
          memset:<br>
        </div>
        <div><br>
        </div>
        <div>#else<br>
        </div>
        <div>  union local_storage ls = {0};</div>
        <div>  return tzloadbody(name, sp, doextend, &ls);</div>
        <div>#endif<br>
        </div>
      </div>
      <br>
      <div class="gmail_quote">
        <div dir="ltr" class="gmail_attr">On Thu, Nov 23, 2023 at
          7:32 PM Alois Treindl via tz <<a href="mailto:tz@iana.org"
            moz-do-not-send="true" class="moz-txt-link-freetext">tz@iana.org</a>>
          wrote:<br>
        </div>
        <blockquote class="gmail_quote"
style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
          <div>
            <p>I have observed occasional crashes in localtime.c in the
              current github version.</p>
            <p>In one of my applications, localtime() is called multiple
              times for several zones.</p>
            <p>The condition when the segmentation fault appears are
              herd to reproduce or demonstrate.</p>
            <p>This patch in function tzload() however solves the issue:</p>
            <p>--- localtime.c    2023-11-16 20:18:01.904577574 +0100<br>
              +++ a/localtime.c    2023-11-23 19:22:21.062249899 +0100<br>
              @@ -769,6 +769,7 @@<br>
                 }<br>
               #else<br>
                 union local_storage ls;<br>
              +  memset(&ls, 0, sizeof(ls));<br>
                 return tzloadbody(name, sp, doextend, &ls);<br>
               #endif<br>
               }<br>
            </p>
          </div>
        </blockquote>
      </div>
    </blockquote>
  </body>
</html>