From dfb1d80f645bfdab6246e2ceacb3a212a310938e Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Tue, 23 Jan 2018 15:34:34 +0000 Subject: [PATCH] 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 --- bin/date/date.c | 1 + 1 file changed, 1 insertion(+) diff --git a/bin/date/date.c b/bin/date/date.c index 089b392c22e..6d0e3d986f1 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;