Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 22 May 2018 16:01:56 +0000 (UTC)
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r334055 - head/sys/netinet/netdump
Message-ID:  <201805221601.w4MG1ufx085137@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: markj
Date: Tue May 22 16:01:56 2018
New Revision: 334055
URL: https://svnweb.freebsd.org/changeset/base/334055

Log:
  Initialize the dumper struct before calling set_dumper().
  
  Fields owned by the generic code were being left uninitialized,
  causing problems in clear_dumper() if an error occurred.
  
  Coverity CID:	1391200
  X-MFC with:	r333283

Modified:
  head/sys/netinet/netdump/netdump_client.c

Modified: head/sys/netinet/netdump/netdump_client.c
==============================================================================
--- head/sys/netinet/netdump/netdump_client.c	Tue May 22 15:54:25 2018	(r334054)
+++ head/sys/netinet/netdump/netdump_client.c	Tue May 22 16:01:56 2018	(r334055)
@@ -1204,6 +1204,7 @@ netdump_ioctl(struct cdev *dev __unused, u_long cmd, c
 			}
 		}
 
+		memset(&dumper, 0, sizeof(dumper));
 		dumper.dumper_start = netdump_start;
 		dumper.dumper_hdr = netdump_write_headers;
 		dumper.dumper = netdump_dumper;



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