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;
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to