aboutsummaryrefslogtreecommitdiff
path: root/bin/date
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>2018-01-23 15:34:34 +0000
committerWarner Losh <imp@FreeBSD.org>2018-01-23 15:34:34 +0000
commitdfb1d80f645bfdab6246e2ceacb3a212a310938e (patch)
tree77c43de497ec0ebfc5965f984b02e7aed72824b2 /bin/date
parent62de70375fea2b37dfe66db613683db0426fb9e0 (diff)
downloadsrc-dfb1d80f645bfdab6246e2ceacb3a212a310938e.tar.gz
src-dfb1d80f645bfdab6246e2ceacb3a212a310938e.zip
Fill in ut_id. While it's not relevant to the {OLD,NEW}_TIME entries,
we shouldn't leak stack garbage into the field. Sponsored by: Netflix
Notes
Notes: svn path=/head/; revision=328282
Diffstat (limited to 'bin/date')
-rw-r--r--bin/date/date.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/bin/date/date.c b/bin/date/date.c
index 089b392c22ed..6d0e3d986f1e 100644
--- a/bin/date/date.c
+++ b/bin/date/date.c
@@ -301,6 +301,7 @@ setthetime(const char *fmt, const char *p, int jflag, int nflag)
/* set the time */
if (nflag || netsettime(tval)) {
utx.ut_type = OLD_TIME;
+ memset(utx.ut_id, 0, sizeof(utx.ut_id));
(void)gettimeofday(&utx.ut_tv, NULL);
pututxline(&utx);
tv.tv_sec = tval;