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:
imp 2018-01-23 15:34:34 +00:00
parent de97098080
commit c9cf794454

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;