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
This commit is contained in:
Warner Losh 2018-01-23 15:34:34 +00:00
parent 62de70375f
commit dfb1d80f64
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=328282

View file

@ -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;