Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 20 Nov 2016 17:03:53 +0000 (UTC)
From:      Luiz Otavio O Souza <loos@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r308891 - stable/11/sbin/etherswitchcfg
Message-ID:  <201611201703.uAKH3rVs070452@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: loos
Date: Sun Nov 20 17:03:52 2016
New Revision: 308891
URL: https://svnweb.freebsd.org/changeset/base/308891

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

Modified:
  stable/11/sbin/etherswitchcfg/etherswitchcfg.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sbin/etherswitchcfg/etherswitchcfg.c
==============================================================================
--- stable/11/sbin/etherswitchcfg/etherswitchcfg.c	Sun Nov 20 16:16:55 2016	(r308890)
+++ stable/11/sbin/etherswitchcfg/etherswitchcfg.c	Sun Nov 20 17:03:52 2016	(r308891)
@@ -274,7 +274,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);
@@ -293,8 +294,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?201611201703.uAKH3rVs070452>