Module Name:    src
Committed By:   christos
Date:           Sat Jan  1 21:01:21 UTC 2022

Modified Files:
        src/lib/libc/time: zic.c

Log Message:
zero out the tzh structure to fix reproducibile builds.


To generate a diff of this commit:
cvs rdiff -u -r1.79 -r1.80 src/lib/libc/time/zic.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/time/zic.c
diff -u src/lib/libc/time/zic.c:1.79 src/lib/libc/time/zic.c:1.80
--- src/lib/libc/time/zic.c:1.79	Fri Oct 22 10:26:04 2021
+++ src/lib/libc/time/zic.c	Sat Jan  1 16:01:21 2022
@@ -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 @@ writezone(const char *const name, const 
 		  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);

Reply via email to