Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 17 Nov 2016 19:02:25 +0000 (UTC)
From:      Luiz Otavio O Souza <loos@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r308775 - head/sbin/etherswitchcfg
Message-ID:  <201611171902.uAHJ2PJw064736@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: loos
Date: Thu Nov 17 19:02:25 2016
New Revision: 308775
URL: https://svnweb.freebsd.org/changeset/base/308775

Log:
  Zero etherswitch_vlangroup structure before doing partial assignments.
  
  MFC after:	3 days
  Sponsored by:	Rubicon Communications, LLC (Netgate)

Modified:
  head/sbin/etherswitchcfg/etherswitchcfg.c

Modified: head/sbin/etherswitchcfg/etherswitchcfg.c
==============================================================================
--- head/sbin/etherswitchcfg/etherswitchcfg.c	Thu Nov 17 18:38:35 2016	(r308774)
+++ head/sbin/etherswitchcfg/etherswitchcfg.c	Thu Nov 17 19:02:25 2016	(r308775)
@@ -308,7 +308,8 @@ set_vlangroup_vid(struct cfg *cfg, char 
 {
 	int v;
 	etherswitch_vlangroup_t vg;
-	
+
+	memset(&vg, 0, sizeof(vg));
 	v = strtol(argv[1], NULL, 0);
 	if (v < 0 || v > IEEE802DOT1Q_VID_MAX)
 		errx(EX_USAGE, "vlan must be between 0 and %d", IEEE802DOT1Q_VID_MAX);
@@ -327,8 +328,9 @@ set_vlangroup_members(struct cfg *cfg, c
 	int member, untagged;
 	char *c, *d;
 	int v;
-	
+
 	member = untagged = 0;
+	memset(&vg, 0, sizeof(vg));
 	if (strcmp(argv[1], "none") != 0) {
 		for (c=argv[1]; *c; c=d) {
 			v = strtol(c, &d, 0);



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