Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[.joined/src/trunk]: .joined/src/lib/libc/time zero out the tzh structure to ...



details:   https://anonhg.NetBSD.org/.joined/src/rev/b84f84ef31e7
branches:  trunk
changeset: 359385:b84f84ef31e7
user:      christos <christos%NetBSD.org@localhost>
date:      Sat Jan 01 21:01:21 2022 +0000

description:
zero out the tzh structure to fix reproducibile builds.

diffstat:

 lib/libc/time/zic.c |  5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diffs (26 lines):

diff -r 0d23cec17d91 -r b84f84ef31e7 lib/libc/time/zic.c
--- a/lib/libc/time/zic.c       Sat Jan 01 19:53:40 2022 +0000
+++ b/lib/libc/time/zic.c       Sat Jan 01 21:01:21 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: zic.c,v 1.79 2021/10/22 14:26:04 christos Exp $        */
+/*     $NetBSD: zic.c,v 1.80 2022/01/01 21:01:21 christos Exp $        */
 /*
 ** This file is in the public domain, so clarified as of
 ** 2006-07-17 by Arthur David Olson.
@@ -11,7 +11,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: zic.c,v 1.79 2021/10/22 14:26:04 christos Exp $");
+__RCSID("$NetBSD: zic.c,v 1.80 2022/01/01 21:01:21 christos Exp $");
 #endif /* !defined lint */
 
 /* Use the system 'time' function, instead of any private replacement.
@@ -2322,6 +2322,7 @@
                  thistypecnt = thischarcnt = 1;
                }
 #define DO(field)      fwrite(tzh.field, sizeof tzh.field, (size_t) 1, fp)
+               memset(&tzh, 0, sizeof(tzh));
                memcpy(tzh.tzh_magic, TZ_MAGIC, sizeof tzh.tzh_magic);
                tzh.tzh_version[0] = version;
                convert(utcnt, tzh.tzh_ttisutcnt);



Home | Main Index | Thread Index | Old Index