svn commit: r328282 - head/bin/date

Warner Losh imp at FreeBSD.org
Tue Jan 23 15:34:35 UTC 2018


Author: imp
Date: Tue Jan 23 15:34:34 2018
New Revision: 328282
URL: https://svnweb.freebsd.org/changeset/base/328282

Log:
  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

Modified:
  head/bin/date/date.c

Modified: head/bin/date/date.c
==============================================================================
--- head/bin/date/date.c	Tue Jan 23 14:33:19 2018	(r328281)
+++ head/bin/date/date.c	Tue Jan 23 15:34:34 2018	(r328282)
@@ -301,6 +301,7 @@ setthetime(const char *fmt, const char *p, int jflag, 
 		/* 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;


More information about the svn-src-all mailing list