Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 23 Jan 2018 15:34:34 +0000 (UTC)
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r328282 - head/bin/date
Message-ID:  <201801231534.w0NFYY7k020158@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201801231534.w0NFYY7k020158>