Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 27 May 2016 17:42:59 +0000 (UTC)
From:      Garrett Cooper <ngie@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r300856 - head/tools/tools/ioat
Message-ID:  <201605271742.u4RHgxZ1078331@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ngie
Date: Fri May 27 17:42:59 2016
New Revision: 300856
URL: https://svnweb.freebsd.org/changeset/base/300856

Log:
  Initialize `t` with memset(.., 0, ..)
  
  This will help ensure that we're not using random garbage on the stack by
  accident with respect to the variable
  
  MFC after: 1 week
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/tools/tools/ioat/ioatcontrol.c

Modified: head/tools/tools/ioat/ioatcontrol.c
==============================================================================
--- head/tools/tools/ioat/ioatcontrol.c	Fri May 27 17:40:29 2016	(r300855)
+++ head/tools/tools/ioat/ioatcontrol.c	Fri May 27 17:42:59 2016	(r300856)
@@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$");
 #include <stdio.h>
 #include <stdint.h>
 #include <stdlib.h>
+#include <string.h>
 #include <sysexits.h>
 #include <unistd.h>
 
@@ -104,6 +105,8 @@ main(int argc, char **argv)
 	bool fflag, rflag, Eflag, mflag;
 	unsigned modeflags;
 
+	memset(&t, 0, sizeof(t));
+
 	fflag = rflag = Eflag = mflag = false;
 	modeflags = 0;
 



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